diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-11-14 18:37:49 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-11-14 18:37:49 +0000 |
commit | 2cf48ca04bf59985117e04dd71644a507be90dbb (patch) | |
tree | 6b1033da07f1805a79bcfb67345aba778559d74e /src/backend/postmaster/postmaster.c | |
parent | 8a9315ca92804bd32b3ee864bf83d98840e1a947 (diff) |
Extend CREATE DATABASE to allow selection of a template database to be
cloned, rather than always cloning template1. Modify initdb to generate
two identical databases rather than one, template0 and template1.
Connections to template0 are disallowed, so that it will always remain
in its virgin as-initdb'd state. pg_dumpall now dumps databases with
restore commands that say CREATE DATABASE foo WITH TEMPLATE = template0.
This allows proper behavior when there is user-added data in template1.
initdb forced!
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 3a140488e4e..68f7c06cd0f 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.186 2000/11/14 18:11:31 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.187 2000/11/14 18:37:42 tgl Exp $ * * NOTES * @@ -279,14 +279,8 @@ checkDataDir(const char *checkdir) exit(2); } -#ifdef OLD_FILE_NAMING - snprintf(path, sizeof(path), "%s%cbase%ctemplate1%cpg_class", - checkdir, SEP_CHAR, SEP_CHAR, SEP_CHAR); -#else - snprintf(path, sizeof(path), "%s%cbase%c%u%c%u", - checkdir, SEP_CHAR, SEP_CHAR, - TemplateDbOid, SEP_CHAR, RelOid_pg_class); -#endif + snprintf(path, sizeof(path), "%s%cglobal%cpg_control", + checkdir, SEP_CHAR, SEP_CHAR); fp = AllocateFile(path, PG_BINARY_R); if (fp == NULL) |