1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

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!
This commit is contained in:
Tom Lane
2000-11-14 18:37:49 +00:00
parent 8a9315ca92
commit 2cf48ca04b
23 changed files with 515 additions and 311 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.120 2000/11/12 00:37:01 tgl Exp $
* $Id: parsenodes.h,v 1.121 2000/11/14 18:37:48 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -645,9 +645,10 @@ typedef struct LoadStmt
typedef struct CreatedbStmt
{
NodeTag type;
char *dbname; /* database to create */
char *dbpath; /* location of database */
int encoding; /* default encoding (see regex/pg_wchar.h) */
char *dbname; /* name of database to create */
char *dbpath; /* location of database (NULL = default) */
char *dbtemplate; /* template to use (NULL = default) */
int encoding; /* MULTIBYTE encoding (-1 = use default) */
} CreatedbStmt;
/* ----------------------