* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.66 2001/05/22 16:52:49 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.67 2001/05/30 14:15:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define XLogFileName(path, log, seg) \
- snprintf(path, MAXPGPATH, "%s%c%08X%08X", \
- XLogDir, SEP_CHAR, log, seg)
+ snprintf(path, MAXPGPATH, "%s/%08X%08X", \
+ XLogDir, log, seg)
#define PrevBufIdx(idx) \
(((idx) == 0) ? XLogCtl->XLogCacheBlck : ((idx) - 1))
* up pre-creating an extra log segment. That seems OK, and better
* than holding the spinlock throughout this lengthy process.
*/
- snprintf(tmppath, MAXPGPATH, "%s%cxlogtemp.%d",
- XLogDir, SEP_CHAR, (int) getpid());
+ snprintf(tmppath, MAXPGPATH, "%s/xlogtemp.%d",
+ XLogDir, (int) getpid());
unlink(tmppath);
{
elog(LOG, "MoveOfflineLogs: %s %s", (XLOG_archive_dir[0]) ?
"archive" : "remove", xlde->d_name);
- sprintf(path, "%s%c%s", XLogDir, SEP_CHAR, xlde->d_name);
+ sprintf(path, "%s/%s", XLogDir, xlde->d_name);
if (XLOG_archive_dir[0] == 0)
unlink(path);
}
XLOGPathInit(void)
{
/* Init XLOG file paths */
- snprintf(XLogDir, MAXPGPATH, "%s%cpg_xlog", DataDir, SEP_CHAR);
- snprintf(ControlFilePath, MAXPGPATH, "%s%cglobal%cpg_control",
- DataDir, SEP_CHAR, SEP_CHAR);
+ snprintf(XLogDir, MAXPGPATH, "%s/pg_xlog", DataDir);
+ snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir);
}
static void
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.40 2001/03/22 03:59:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.41 2001/05/30 14:15:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
/* XXX why is this inconsistent with relpath() ? */
path = (char *) palloc(strlen(DatabasePath) + sizeof(NameData) + 2);
- sprintf(path, "%s%c%s", DatabasePath, SEP_CHAR, relname);
+ sprintf(path, "%s/%s", DatabasePath, relname);
}
else
{
elog(FATAL, "relpath_blind: can't expand path for db %s",
dbname);
path = (char *) palloc(strlen(dbpath) + sizeof(NameData) + 2);
- sprintf(path, "%s%c%s", dbpath, SEP_CHAR, relname);
+ sprintf(path, "%s/%s", dbpath, relname);
pfree(dbpath);
}
return path;
{
/* Shared system relations live in {datadir}/global */
path = (char *) palloc(strlen(DataDir) + 8 + sizeof(NameData) + 1);
- sprintf(path, "%s%cglobal%c%u", DataDir, SEP_CHAR, SEP_CHAR, rnode.relNode);
+ sprintf(path, "%s/global/%u", DataDir, rnode.relNode);
}
else
{
path = (char *) palloc(strlen(DataDir) + 6 + 2 * sizeof(NameData) + 3);
- sprintf(path, "%s%cbase%c%u%c%u", DataDir, SEP_CHAR, SEP_CHAR,
- rnode.tblNode, SEP_CHAR, rnode.relNode);
+ sprintf(path, "%s/base/%u/%u", DataDir, rnode.tblNode, rnode.relNode);
}
return path;
}
{
/* Shared system relations live in {datadir}/global */
path = (char *) palloc(strlen(DataDir) + 8);
- sprintf(path, "%s%cglobal", DataDir, SEP_CHAR);
+ sprintf(path, "%s/global", DataDir);
}
else
{
path = (char *) palloc(strlen(DataDir) + 6 + sizeof(NameData) + 1);
- sprintf(path, "%s%cbase%c%u", DataDir, SEP_CHAR, SEP_CHAR, tblNode);
+ sprintf(path, "%s/base/%u", DataDir, tblNode);
}
return path;
}
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.214 2001/05/25 15:45:33 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.215 2001/05/30 14:15:26 momjian Exp $
*
* NOTES
*
ExitPostmaster(2);
}
- snprintf(path, sizeof(path), "%s%cglobal%cpg_control",
- checkdir, SEP_CHAR, SEP_CHAR);
+ snprintf(path, sizeof(path), "%s/global/pg_control", checkdir);
fp = AllocateFile(path, PG_BINARY_R);
if (fp == NULL)
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.78 2001/05/25 15:45:33 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.79 2001/05/30 14:15:26 momjian Exp $
*
* NOTES:
*
int len;
/* Not an absolute path name? Then fill in with database path... */
- if (*filename != SEP_CHAR)
+ if (*filename != '/')
{
len = strlen(DatabasePath) + strlen(filename) + 2;
buf = (char *) palloc(len);
- sprintf(buf, "%s%c%s", DatabasePath, SEP_CHAR, filename);
+ sprintf(buf, "%s/%s", DatabasePath, filename);
}
else
{
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.134 2001/05/14 22:06:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.135 2001/05/30 14:15:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* another backend starting at about the same time might crash trying
* to read the partially-complete file.
*/
- snprintf(tempfilename, sizeof(tempfilename), "%s%c%s.%d",
- DatabasePath, SEP_CHAR, RELCACHE_INIT_FILENAME, MyProcPid);
- snprintf(finalfilename, sizeof(finalfilename), "%s%c%s",
- DatabasePath, SEP_CHAR, RELCACHE_INIT_FILENAME);
+ snprintf(tempfilename, sizeof(tempfilename), "%s/%s.%d",
+ DatabasePath, RELCACHE_INIT_FILENAME, MyProcPid);
+ snprintf(finalfilename, sizeof(finalfilename), "%s/%s",
+ DatabasePath, RELCACHE_INIT_FILENAME);
fd = PathNameOpenFile(tempfilename, O_WRONLY | O_CREAT | O_TRUNC | PG_BINARY, 0600);
if (fd < 0)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.83 2001/03/22 03:59:58 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.84 2001/05/30 14:15:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
fd = fileno(stderr);
if (fcntl(fd, F_GETFD, 0) < 0)
{
- snprintf(OutputFileName, MAXPGPATH, "%s%cpg.errors.%d",
- DataDir, SEP_CHAR, (int) MyProcPid);
+ snprintf(OutputFileName, MAXPGPATH, "%s/pg.errors.%d",
+ DataDir, (int) MyProcPid);
fd = open(OutputFileName, O_CREAT | O_APPEND | O_WRONLY, 0666);
}
if (fd < 0)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.45 2001/03/22 06:16:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.46 2001/05/30 14:15:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
return NULL; /* ain't gonna fit nohow */
/* leading path delimiter? then already absolute path */
- if (*dbpath == SEP_CHAR)
+ if (*dbpath == '/')
{
#ifdef ALLOW_ABSOLUTE_DBPATHS
- cp = strrchr(dbpath, SEP_CHAR);
+ cp = strrchr(dbpath, '/');
len = cp - dbpath;
strncpy(buf, dbpath, len);
- snprintf(&buf[len], MAXPGPATH - len, "%cbase%c%s",
- SEP_CHAR, SEP_CHAR, (cp + 1));
+ snprintf(&buf[len], MAXPGPATH - len, "/base/%s", (cp + 1));
#else
return NULL;
#endif
}
/* path delimiter somewhere? then has leading environment variable */
- else if ((cp = strchr(dbpath, SEP_CHAR)) != NULL)
+ else if ((cp = strchr(dbpath, '/')) != NULL)
{
const char *envvar;
if (envvar == NULL)
return NULL;
- snprintf(buf, sizeof(buf), "%s%cbase%c%s",
- envvar, SEP_CHAR, SEP_CHAR, (cp + 1));
+ snprintf(buf, sizeof(buf), "%s/base/%s", envvar, (cp + 1));
}
else
{
/* no path delimiter? then add the default path prefix */
- snprintf(buf, sizeof(buf), "%s%cbase%c%s",
- DataDir, SEP_CHAR, SEP_CHAR, dbpath);
+ snprintf(buf, sizeof(buf), "%s/base/%s", DataDir, dbpath);
}
/*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.209 2001/05/22 16:37:16 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.210 2001/05/30 14:15:27 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
*
* - Dump dependency information in dumpType. This is necessary
* because placeholder types will have an OID less than the
- * OID of the type functions, but type must be created after
+ * OID of the type functions, but type must be created after
* the functions.
*
* Modifications - 4-Apr-2001 - pjw@rhyme.com.au
dataOnly = schemaOnly = dumpData = attrNames = false;
- if (!strrchr(argv[0], SEP_CHAR))
+ if (!strrchr(argv[0], '/'))
progname = argv[0];
else
- progname = strrchr(argv[0], SEP_CHAR) + 1;
+ progname = strrchr(argv[0], '/') + 1;
/* Set defaulty options based on progname */
if (strcmp(progname, "pg_backup") == 0)
"order by oid",
RELKIND_RELATION, RELKIND_SEQUENCE, RELKIND_VIEW);
} else {
- /*
+ /*
* Before 7.1, view relkind was not set to 'v', so we must check
* if we have a view by looking for a rule in pg_rewrite.
*/
else
tblinfo[i].viewdef = NULL;
- /*
+ /*
* Get non-inherited CHECK constraints, if any.
*
* Exclude inherited CHECKs from CHECK constraints total. If a
* constraint matches by name and condition with a constraint
* belonging to a parent class (OR conditions match and both
- * names start with '$', we assume it was inherited.
+ * names start with '$', we assume it was inherited.
*/
if (tblinfo[i].ncheck > 0)
{
int n;
resetPQExpBuffer(query);
- if (g_fout->remoteVersion < 70100)
+ if (g_fout->remoteVersion < 70100)
{
/* Fake the LOJ from below */
appendPQExpBuffer(query,
g_comment_end);
resetPQExpBuffer(query);
- appendPQExpBuffer(query,
+ appendPQExpBuffer(query,
"SELECT tgname, tgfoid, tgtype, tgnargs, tgargs, "
"tgisconstraint, tgconstrname, tgdeferrable, "
"tgconstrrelid, tginitdeferred, oid, "
if (strcmp(tgconstrrelid, "0") != 0) {
if (PQgetisnull(res2, i2, i_tgconstrrelname))
- {
- fprintf(stderr, "getTables(): SELECT produced NULL referenced table name "
+ {
+ fprintf(stderr, "getTables(): SELECT produced NULL referenced table name "
"for trigger '%s' on relation '%s' (oid was %s).\n",
tgname, tblinfo[i].relname, tgconstrrelid);
- exit_nicely(g_conn);
- }
+ exit_nicely(g_conn);
+ }
- appendPQExpBuffer(query, " FROM %s",
+ appendPQExpBuffer(query, " FROM %s",
fmtId(PQgetvalue(res2, i2, i_tgconstrrelname), force_quotes));
}
if (!tgdeferrable)
if (g_fout->remoteVersion < 70100)
{
/* Fake the LOJ below */
- appendPQExpBuffer(q,
+ appendPQExpBuffer(q,
" SELECT a.oid as attoid, a.attnum, a.attname, t.typname, a.atttypmod, "
" a.attnotnull, a.atthasdef, NULL as atttypedefn "
" from pg_attribute a, pg_type t "
* this is probably not foolproof but comes close
*/
-static Oid
+static Oid
findLastBuiltinOid_V70(void)
{
PGresult *res;
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.48 2001/05/12 19:44:46 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.49 2001/05/30 14:15:27 momjian Exp $
*/
#include "postgres_fe.h"
char *password = NULL;
bool need_pass;
- if (!strrchr(argv[0], SEP_CHAR))
+ if (!strrchr(argv[0], '/'))
pset.progname = argv[0];
else
- pset.progname = strrchr(argv[0], SEP_CHAR) + 1;
+ pset.progname = strrchr(argv[0], '/') + 1;
if (argc > 1)
{
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: c.h,v 1.92 2001/03/22 04:00:24 momjian Exp $
+ * $Id: c.h,v 1.93 2001/05/30 14:15:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/* These are for things that are one way on Unix and another on NT */
#define NULL_DEV "/dev/null"
-#define SEP_CHAR '/'
/* defines for dynamic linking on Win32 platform */
#ifdef __CYGWIN__