aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-11-14 18:37:49 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-11-14 18:37:49 +0000
commit2cf48ca04bf59985117e04dd71644a507be90dbb (patch)
tree6b1033da07f1805a79bcfb67345aba778559d74e /src/backend/nodes/copyfuncs.c
parent8a9315ca92804bd32b3ee864bf83d98840e1a947 (diff)
downloadpostgresql-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/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 3490ef80624..9c342b5dc1e 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.131 2000/11/12 00:36:57 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.132 2000/11/14 18:37:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2231,6 +2231,8 @@ _copyCreatedbStmt(CreatedbStmt *from)
newnode->dbname = pstrdup(from->dbname);
if (from->dbpath)
newnode->dbpath = pstrdup(from->dbpath);
+ if (from->dbtemplate)
+ newnode->dbtemplate = pstrdup(from->dbtemplate);
newnode->encoding = from->encoding;
return newnode;