Re: Create database bug in 8.1.3 ? - Mailing list pgsql-general

From William ZHANG
Subject Re: Create database bug in 8.1.3 ?
Date
Msg-id e1av3c$1i58$1@news.hub.org
Whole thread Raw
In response to Create database bug in 8.1.3 ?  ("Milen Kulev" <makulev@gmx.net>)
Responses Re: Create database bug in 8.1.3 ? -> solved  ("Milen Kulev" <makulev@gmx.net>)
"Pg_restore -C" is not creating a database ( Was Create database bug in 8.1.3 ? )  ("Milen Kulev" <makulev@gmx.net>)
List pgsql-general
The backend doesnot save the name of the template database used by
"CREATE DATABASE".

pg_dump, pg_dumpall have hard code like this:
    appendPQExpBuffer(buf, " WITH TEMPLATE = template0");
That's why you found the template database is always `template0`.

If the backend saves the name of the template database, and dump the
database as
    "CREATE DATABASE foo WITH TEMPLATE 'bar';",
dump and restore should be careful to dump/restore 'bar' before 'foo'. If
'bar' is
modified after the "CREATE DATABASE" command, things will be more
complicated.

If you have not modified system catalogs in template1, using template0 in
dump
should cause no problem.

Regrads,
William ZHANG



pgsql-general by date:

Previous
From: Alex Mayrhofer
Date:
Subject: index growth
Next
From: "Milen Kulev"
Date:
Subject: Re: Create database bug in 8.1.3 ? -> solved