1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +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

@ -3,7 +3,7 @@
* client encoding and server internal encoding.
* (currently mule internal code (mic) is used)
* Tatsuo Ishii
* $Id: mbutils.c,v 1.13 2000/10/30 10:40:28 ishii Exp $ */
* $Id: mbutils.c,v 1.14 2000/11/14 18:37:44 tgl Exp $ */
#include "postgres.h"
@ -271,6 +271,7 @@ pg_mbcliplen(const unsigned char *mbstr, int len, int limit)
* fuctions for utils/init
*/
static int DatabaseEncoding = MULTIBYTE;
void
SetDatabaseEncoding(int encoding)
{
@ -289,17 +290,3 @@ getdatabaseencoding(PG_FUNCTION_ARGS)
{
PG_RETURN_NAME(pg_encoding_to_char(DatabaseEncoding));
}
/* set and get template1 database encoding */
static int templateEncoding;
void
SetTemplateEncoding(int encoding)
{
templateEncoding = encoding;
}
int
GetTemplateEncoding()
{
return (templateEncoding);
}