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/tcop/utility.c | |
parent | 8a9315ca92804bd32b3ee864bf83d98840e1a947 (diff) | |
download | postgresql-2cf48ca04bf59985117e04dd71644a507be90dbb.tar.gz postgresql-2cf48ca04bf59985117e04dd71644a507be90dbb.zip |
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/tcop/utility.c')
-rw-r--r-- | src/backend/tcop/utility.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 79ac7c0f157..63a43315286 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.101 2000/11/08 16:31:06 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.102 2000/11/14 18:37:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -604,7 +604,8 @@ ProcessUtility(Node *parsetree, set_ps_display(commandTag = "CREATE DATABASE"); - createdb(stmt->dbname, stmt->dbpath, stmt->encoding); + createdb(stmt->dbname, stmt->dbpath, + stmt->dbtemplate, stmt->encoding); } break; |