Skip to content

Commit ef5bea5

Browse files
committed
Move global internal files to PGDATA/global.
1 parent e2d3932 commit ef5bea5

File tree

6 files changed

+31
-30
lines changed

6 files changed

+31
-30
lines changed

src/backend/bootstrap/bootstrap.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.88 2000/06/28 03:31:09 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.89 2000/07/03 20:48:27 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -347,10 +347,8 @@ BootstrapMain(int argc, char *argv[])
347347
*/
348348
if (IsUnderPostmaster || xloginit)
349349
{
350-
snprintf(XLogDir, MAXPGPATH, "%s%cpg_xlog",
351-
DataDir, SEP_CHAR);
352-
snprintf(ControlFilePath, MAXPGPATH, "%s%cpg_control",
353-
DataDir, SEP_CHAR);
350+
snprintf(XLogDir, MAXPGPATH, "%s/pg_xlog", DataDir);
351+
snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir);
354352
}
355353

356354
if (IsUnderPostmaster && xloginit)

src/backend/catalog/catalog.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.32 2000/04/12 17:14:55 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.33 2000/07/03 20:48:28 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -37,11 +37,11 @@ relpath(const char *relname)
3737

3838
if (IsSharedSystemRelationName(relname))
3939
{
40-
/* Shared system relations live in DataDir */
41-
size_t bufsize = strlen(DataDir) + sizeof(NameData) + 2;
40+
/* Shared system relations live in {datadir}/global */
41+
size_t bufsize = strlen(DataDir) + 8 + sizeof(NameData) + 1;
4242

4343
path = (char *) palloc(bufsize);
44-
snprintf(path, bufsize, "%s%c%s", DataDir, SEP_CHAR, relname);
44+
snprintf(path, bufsize, "%s/global/%s", DataDir, relname);
4545
return path;
4646
}
4747

@@ -71,9 +71,9 @@ relpath_blind(const char *dbname, const char *relname,
7171

7272
if (dbid == (Oid) 0)
7373
{
74-
/* Shared system relations live in DataDir */
75-
path = (char *) palloc(strlen(DataDir) + sizeof(NameData) + 2);
76-
sprintf(path, "%s%c%s", DataDir, SEP_CHAR, relname);
74+
/* Shared system relations live in {datadir}/global */
75+
path = (char *) palloc(strlen(DataDir) + 8 + sizeof(NameData) + 1);
76+
sprintf(path, "%s/global/%s", DataDir, relname);
7777
}
7878
else if (dbid == MyDatabaseId)
7979
{

src/backend/libpq/crypt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Dec 17, 1997 - Todd A. Brandys
1010
* Orignal Version Completed.
1111
*
12-
* $Id: crypt.c,v 1.25 2000/06/09 01:11:06 tgl Exp $
12+
* $Id: crypt.c,v 1.26 2000/07/03 20:48:30 petere Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -38,9 +38,9 @@ crypt_getpwdfilename()
3838
static char *pfnam = NULL;
3939
int bufsize;
4040

41-
bufsize = strlen(DataDir) + strlen(CRYPT_PWD_FILE) + 2;
41+
bufsize = strlen(DataDir) + 8 + strlen(CRYPT_PWD_FILE) + 1;
4242
pfnam = (char *) palloc(bufsize);
43-
snprintf(pfnam, bufsize, "%s/%s", DataDir, CRYPT_PWD_FILE);
43+
snprintf(pfnam, bufsize, "%s/global/%s", DataDir, CRYPT_PWD_FILE);
4444

4545
return pfnam;
4646
}

src/backend/tcop/postgres.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.164 2000/07/03 20:46:00 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.165 2000/07/03 20:48:37 petere Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1294,10 +1294,8 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
12941294
on_proc_exit(UnlinkPidFile, NULL);
12951295

12961296
BaseInit();
1297-
snprintf(XLogDir, MAXPGPATH, "%s%cpg_xlog",
1298-
DataDir, SEP_CHAR);
1299-
snprintf(ControlFilePath, MAXPGPATH, "%s%cpg_control",
1300-
DataDir, SEP_CHAR);
1297+
snprintf(XLogDir, MAXPGPATH, "%s/pg_xlog", DataDir);
1298+
snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir);
13011299
StartupXLOG();
13021300
}
13031301

@@ -1406,7 +1404,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
14061404
if (!IsUnderPostmaster)
14071405
{
14081406
puts("\nPOSTGRES backend interactive interface ");
1409-
puts("$Revision: 1.164 $ $Date: 2000/07/03 20:46:00 $\n");
1407+
puts("$Revision: 1.165 $ $Date: 2000/07/03 20:48:37 $\n");
14101408
}
14111409

14121410
/*

src/backend/utils/misc/database.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.38 2000/06/02 15:57:34 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.39 2000/07/03 20:48:42 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -143,8 +143,8 @@ GetRawDatabaseInfo(const char *name, Oid *db_id, char *path)
143143
char *dbfname;
144144
Form_pg_database tup_db;
145145

146-
dbfname = (char *) palloc(strlen(DataDir) + strlen(DatabaseRelationName) + 2);
147-
sprintf(dbfname, "%s%c%s", DataDir, SEP_CHAR, DatabaseRelationName);
146+
dbfname = (char *) palloc(strlen(DataDir) + 8 + strlen(DatabaseRelationName) + 2);
147+
sprintf(dbfname, "%s/global/%s", DataDir, DatabaseRelationName);
148148

149149
if ((dbfd = open(dbfname, O_RDONLY | PG_BINARY, 0)) < 0)
150150
elog(FATAL, "cannot open %s: %s", dbfname, strerror(errno));

src/bin/initdb/initdb.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
#
2828
# IDENTIFICATION
29-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.98 2000/07/02 15:21:00 petere Exp $
29+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.99 2000/07/03 20:48:46 petere Exp $
3030
#
3131
#-------------------------------------------------------------------------
3232

@@ -406,21 +406,26 @@ then
406406
else
407407
if [ ! -d "$PGDATA" ]
408408
then
409-
echo "Creating database system directory $PGDATA"
409+
echo "Creating directory $PGDATA"
410410
mkdir "$PGDATA" || exit_nicely
411411
else
412-
echo "Fixing permissions on pre-existing data directory $PGDATA"
412+
echo "Fixing permissions on existing directory $PGDATA"
413413
chmod go-rwx "$PGDATA" || exit_nicely
414414
fi
415415

416416
if [ ! -d "$PGDATA"/base ]
417417
then
418-
echo "Creating database system directory $PGDATA/base"
418+
echo "Creating directory $PGDATA/base"
419419
mkdir "$PGDATA"/base || exit_nicely
420420
fi
421+
if [ ! -d "$PGDATA"/global ]
422+
then
423+
echo "Creating directory $PGDATA/global"
424+
mkdir "$PGDATA"/global || exit_nicely
425+
fi
421426
if [ ! -d "$PGDATA"/pg_xlog ]
422427
then
423-
echo "Creating database XLOG directory $PGDATA/pg_xlog"
428+
echo "Creating directory $PGDATA/pg_xlog"
424429
mkdir "$PGDATA"/pg_xlog || exit_nicely
425430
fi
426431
fi
@@ -458,7 +463,7 @@ echo $short_version > "$PGDATA"/base/template1/PG_VERSION || exit_nicely
458463

459464
if [ "$template_only" -eq 0 ]
460465
then
461-
echo "Creating global relations in $PGDATA/base"
466+
echo "Creating global relations in $PGDATA/global"
462467
[ "$debug" -ne 0 ] && echo "Running: $PGPATH/postgres $BACKENDARGS template1"
463468

464469
cat "$GLOBAL" \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy