mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
Move global internal files to PGDATA/global.
This commit is contained in:
parent
e2d3932e0e
commit
ef5bea51e1
@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.88 2000/06/28 03:31:09 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.89 2000/07/03 20:48:27 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -347,10 +347,8 @@ BootstrapMain(int argc, char *argv[])
|
||||
*/
|
||||
if (IsUnderPostmaster || xloginit)
|
||||
{
|
||||
snprintf(XLogDir, MAXPGPATH, "%s%cpg_xlog",
|
||||
DataDir, SEP_CHAR);
|
||||
snprintf(ControlFilePath, MAXPGPATH, "%s%cpg_control",
|
||||
DataDir, SEP_CHAR);
|
||||
snprintf(XLogDir, MAXPGPATH, "%s/pg_xlog", DataDir);
|
||||
snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir);
|
||||
}
|
||||
|
||||
if (IsUnderPostmaster && xloginit)
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.32 2000/04/12 17:14:55 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.33 2000/07/03 20:48:28 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -37,11 +37,11 @@ relpath(const char *relname)
|
||||
|
||||
if (IsSharedSystemRelationName(relname))
|
||||
{
|
||||
/* Shared system relations live in DataDir */
|
||||
size_t bufsize = strlen(DataDir) + sizeof(NameData) + 2;
|
||||
/* Shared system relations live in {datadir}/global */
|
||||
size_t bufsize = strlen(DataDir) + 8 + sizeof(NameData) + 1;
|
||||
|
||||
path = (char *) palloc(bufsize);
|
||||
snprintf(path, bufsize, "%s%c%s", DataDir, SEP_CHAR, relname);
|
||||
snprintf(path, bufsize, "%s/global/%s", DataDir, relname);
|
||||
return path;
|
||||
}
|
||||
|
||||
@ -71,9 +71,9 @@ relpath_blind(const char *dbname, const char *relname,
|
||||
|
||||
if (dbid == (Oid) 0)
|
||||
{
|
||||
/* Shared system relations live in DataDir */
|
||||
path = (char *) palloc(strlen(DataDir) + sizeof(NameData) + 2);
|
||||
sprintf(path, "%s%c%s", DataDir, SEP_CHAR, relname);
|
||||
/* Shared system relations live in {datadir}/global */
|
||||
path = (char *) palloc(strlen(DataDir) + 8 + sizeof(NameData) + 1);
|
||||
sprintf(path, "%s/global/%s", DataDir, relname);
|
||||
}
|
||||
else if (dbid == MyDatabaseId)
|
||||
{
|
||||
|
@ -9,7 +9,7 @@
|
||||
* Dec 17, 1997 - Todd A. Brandys
|
||||
* Orignal Version Completed.
|
||||
*
|
||||
* $Id: crypt.c,v 1.25 2000/06/09 01:11:06 tgl Exp $
|
||||
* $Id: crypt.c,v 1.26 2000/07/03 20:48:30 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -38,9 +38,9 @@ crypt_getpwdfilename()
|
||||
static char *pfnam = NULL;
|
||||
int bufsize;
|
||||
|
||||
bufsize = strlen(DataDir) + strlen(CRYPT_PWD_FILE) + 2;
|
||||
bufsize = strlen(DataDir) + 8 + strlen(CRYPT_PWD_FILE) + 1;
|
||||
pfnam = (char *) palloc(bufsize);
|
||||
snprintf(pfnam, bufsize, "%s/%s", DataDir, CRYPT_PWD_FILE);
|
||||
snprintf(pfnam, bufsize, "%s/global/%s", DataDir, CRYPT_PWD_FILE);
|
||||
|
||||
return pfnam;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.164 2000/07/03 20:46:00 petere Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.165 2000/07/03 20:48:37 petere Exp $
|
||||
*
|
||||
* NOTES
|
||||
* 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[])
|
||||
on_proc_exit(UnlinkPidFile, NULL);
|
||||
|
||||
BaseInit();
|
||||
snprintf(XLogDir, MAXPGPATH, "%s%cpg_xlog",
|
||||
DataDir, SEP_CHAR);
|
||||
snprintf(ControlFilePath, MAXPGPATH, "%s%cpg_control",
|
||||
DataDir, SEP_CHAR);
|
||||
snprintf(XLogDir, MAXPGPATH, "%s/pg_xlog", DataDir);
|
||||
snprintf(ControlFilePath, MAXPGPATH, "%s/global/pg_control", DataDir);
|
||||
StartupXLOG();
|
||||
}
|
||||
|
||||
@ -1406,7 +1404,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
puts("\nPOSTGRES backend interactive interface ");
|
||||
puts("$Revision: 1.164 $ $Date: 2000/07/03 20:46:00 $\n");
|
||||
puts("$Revision: 1.165 $ $Date: 2000/07/03 20:48:37 $\n");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.38 2000/06/02 15:57:34 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.39 2000/07/03 20:48:42 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -143,8 +143,8 @@ GetRawDatabaseInfo(const char *name, Oid *db_id, char *path)
|
||||
char *dbfname;
|
||||
Form_pg_database tup_db;
|
||||
|
||||
dbfname = (char *) palloc(strlen(DataDir) + strlen(DatabaseRelationName) + 2);
|
||||
sprintf(dbfname, "%s%c%s", DataDir, SEP_CHAR, DatabaseRelationName);
|
||||
dbfname = (char *) palloc(strlen(DataDir) + 8 + strlen(DatabaseRelationName) + 2);
|
||||
sprintf(dbfname, "%s/global/%s", DataDir, DatabaseRelationName);
|
||||
|
||||
if ((dbfd = open(dbfname, O_RDONLY | PG_BINARY, 0)) < 0)
|
||||
elog(FATAL, "cannot open %s: %s", dbfname, strerror(errno));
|
||||
|
@ -26,7 +26,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.98 2000/07/02 15:21:00 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.99 2000/07/03 20:48:46 petere Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -406,21 +406,26 @@ then
|
||||
else
|
||||
if [ ! -d "$PGDATA" ]
|
||||
then
|
||||
echo "Creating database system directory $PGDATA"
|
||||
echo "Creating directory $PGDATA"
|
||||
mkdir "$PGDATA" || exit_nicely
|
||||
else
|
||||
echo "Fixing permissions on pre-existing data directory $PGDATA"
|
||||
echo "Fixing permissions on existing directory $PGDATA"
|
||||
chmod go-rwx "$PGDATA" || exit_nicely
|
||||
fi
|
||||
|
||||
if [ ! -d "$PGDATA"/base ]
|
||||
then
|
||||
echo "Creating database system directory $PGDATA/base"
|
||||
echo "Creating directory $PGDATA/base"
|
||||
mkdir "$PGDATA"/base || exit_nicely
|
||||
fi
|
||||
if [ ! -d "$PGDATA"/global ]
|
||||
then
|
||||
echo "Creating directory $PGDATA/global"
|
||||
mkdir "$PGDATA"/global || exit_nicely
|
||||
fi
|
||||
if [ ! -d "$PGDATA"/pg_xlog ]
|
||||
then
|
||||
echo "Creating database XLOG directory $PGDATA/pg_xlog"
|
||||
echo "Creating directory $PGDATA/pg_xlog"
|
||||
mkdir "$PGDATA"/pg_xlog || exit_nicely
|
||||
fi
|
||||
fi
|
||||
@ -458,7 +463,7 @@ echo $short_version > "$PGDATA"/base/template1/PG_VERSION || exit_nicely
|
||||
|
||||
if [ "$template_only" -eq 0 ]
|
||||
then
|
||||
echo "Creating global relations in $PGDATA/base"
|
||||
echo "Creating global relations in $PGDATA/global"
|
||||
[ "$debug" -ne 0 ] && echo "Running: $PGPATH/postgres $BACKENDARGS template1"
|
||||
|
||||
cat "$GLOBAL" \
|
||||
|
Loading…
Reference in New Issue
Block a user