Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
33f2614a
Commit
33f2614a
authored
May 30, 2001
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove SEP_CHAR, replace with / or '/' as appropriate.
parent
f032b70c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
55 additions
and
62 deletions
+55
-62
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+8
-9
src/backend/catalog/catalog.c
src/backend/catalog/catalog.c
+7
-8
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+2
-3
src/backend/storage/file/fd.c
src/backend/storage/file/fd.c
+3
-3
src/backend/utils/cache/relcache.c
src/backend/utils/cache/relcache.c
+5
-5
src/backend/utils/error/elog.c
src/backend/utils/error/elog.c
+3
-3
src/backend/utils/misc/database.c
src/backend/utils/misc/database.c
+7
-10
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+16
-16
src/bin/psql/startup.c
src/bin/psql/startup.c
+3
-3
src/include/c.h
src/include/c.h
+1
-2
No files found.
src/backend/access/transam/xlog.c
View file @
33f2614a
...
...
@@ -7,7 +7,7 @@
* 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.6
6 2001/05/22 16:52:49
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.6
7 2001/05/30 14:15:25
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -336,8 +336,8 @@ static ControlFileData *ControlFile = NULL;
#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))
...
...
@@ -1300,8 +1300,8 @@ XLogFileInit(uint32 log, uint32 seg,
* up pre-creating an extra log segment. That seems OK, and better
* than holding the spinlock throughout this lengthy process.
*/
snprintf
(
tmppath
,
MAXPGPATH
,
"%s
%c
xlogtemp.%d"
,
XLogDir
,
SEP_CHAR
,
(
int
)
getpid
());
snprintf
(
tmppath
,
MAXPGPATH
,
"%s
/
xlogtemp.%d"
,
XLogDir
,
(
int
)
getpid
());
unlink
(
tmppath
);
...
...
@@ -1495,7 +1495,7 @@ MoveOfflineLogs(uint32 log, uint32 seg)
{
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
);
}
...
...
@@ -1911,9 +1911,8 @@ void
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
...
...
src/backend/catalog/catalog.c
View file @
33f2614a
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.4
0 2001/03/22 03:59:19
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.4
1 2001/05/30 14:15:26
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -80,7 +80,7 @@ relpath_blind(const char *dbname, const char *relname,
{
/* 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
{
...
...
@@ -99,7 +99,7 @@ relpath_blind(const char *dbname, const char *relname,
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
;
...
...
@@ -122,13 +122,12 @@ relpath(RelFileNode rnode)
{
/* 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
;
}
...
...
@@ -148,12 +147,12 @@ GetDatabasePath(Oid tblNode)
{
/* 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
;
}
...
...
src/backend/postmaster/postmaster.c
View file @
33f2614a
...
...
@@ -28,7 +28,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.21
4 2001/05/25 15:45:33
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.21
5 2001/05/30 14:15:26
momjian Exp $
*
* NOTES
*
...
...
@@ -272,8 +272,7 @@ checkDataDir(const char *checkdir)
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
)
...
...
src/backend/storage/file/fd.c
View file @
33f2614a
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.7
8 2001/05/25 15:45:33
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.7
9 2001/05/30 14:15:26
momjian Exp $
*
* NOTES:
*
...
...
@@ -580,11 +580,11 @@ filepath(char *filename)
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
{
...
...
src/backend/utils/cache/relcache.c
View file @
33f2614a
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.13
4 2001/05/14 22:06:41
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.13
5 2001/05/30 14:15:26
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2810,10 +2810,10 @@ write_irels(void)
* 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
)
...
...
src/backend/utils/error/elog.c
View file @
33f2614a
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.8
3 2001/03/22 03:59:58
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.8
4 2001/05/30 14:15:26
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -562,8 +562,8 @@ DebugFileOpen(void)
fd
=
fileno
(
stderr
);
if
(
fcntl
(
fd
,
F_GETFD
,
0
)
<
0
)
{
snprintf
(
OutputFileName
,
MAXPGPATH
,
"%s
%c
pg.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
)
...
...
src/backend/utils/misc/database.c
View file @
33f2614a
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.4
5 2001/03/22 06:16:19
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.4
6 2001/05/30 14:15:27
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -52,20 +52,19 @@ ExpandDatabasePath(const char *dbpath)
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
;
...
...
@@ -76,14 +75,12 @@ ExpandDatabasePath(const char *dbpath)
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
);
}
/*
...
...
src/bin/pg_dump/pg_dump.c
View file @
33f2614a
...
...
@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.2
09 2001/05/22 16:37:16 petere
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.2
10 2001/05/30 14:15:27 momjian
Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
...
...
@@ -119,7 +119,7 @@
*
* - 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
...
...
@@ -773,10 +773,10 @@ main(int argc, char **argv)
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
)
...
...
@@ -2078,7 +2078,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
"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.
*/
...
...
@@ -2195,13 +2195,13 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
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
)
{
...
...
@@ -2313,7 +2313,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
int
n
;
resetPQExpBuffer
(
query
);
if
(
g_fout
->
remoteVersion
<
70100
)
if
(
g_fout
->
remoteVersion
<
70100
)
{
/* Fake the LOJ from below */
appendPQExpBuffer
(
query
,
...
...
@@ -2404,7 +2404,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
g_comment_end
);
resetPQExpBuffer
(
query
);
appendPQExpBuffer
(
query
,
appendPQExpBuffer
(
query
,
"SELECT tgname, tgfoid, tgtype, tgnargs, tgargs, "
"tgisconstraint, tgconstrname, tgdeferrable, "
"tgconstrrelid, tginitdeferred, oid, "
...
...
@@ -2575,14 +2575,14 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
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
)
...
...
@@ -2770,7 +2770,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
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 "
...
...
@@ -4649,7 +4649,7 @@ findLastBuiltinOid_V71(const char *dbname)
* this is probably not foolproof but comes close
*/
static
Oid
static
Oid
findLastBuiltinOid_V70
(
void
)
{
PGresult
*
res
;
...
...
src/bin/psql/startup.c
View file @
33f2614a
...
...
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.4
8 2001/05/12 19:44:46 petere
Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.4
9 2001/05/30 14:15:27 momjian
Exp $
*/
#include "postgres_fe.h"
...
...
@@ -102,10 +102,10 @@ main(int argc, char *argv[])
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
)
{
...
...
src/include/c.h
View file @
33f2614a
...
...
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: c.h,v 1.9
2 2001/03/22 04:00:24
momjian Exp $
* $Id: c.h,v 1.9
3 2001/05/30 14:15:27
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -594,7 +594,6 @@ typedef NameData *Name;
/* 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__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment