From: | "Florian G(dot) Pflug" <fgp(at)phlo(dot)org> |
---|---|
To: | Milen Kulev <makulev(at)gmx(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Create database bug in 8.1.3 ? |
Date: | 2006-04-11 16:52:50 |
Message-ID: | 443BDEE2.6080902@phlo.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Milen Kulev wrote:
> Hi Listers,
> I have the following problem (OS= RHELU2 , PG version= 8.1.3) when I try to Create a database :
>
> postgres=# CREATE DATABASE world3 TEMPLATE=template1 ENCODING='UTF8' TABLESPACE=tbs1 ;
> CREATE DATABASE
>
> Then I am backup-ing the database (a small toy DB) with pg_dumpall:
>
> pg_dumpall > alldb.bak
>
> Less alldb.bak:
> --------------------
> ....
> CREATE DATABASE world3 WITH TEMPLATE = template0 OWNER = pg ENCODING = 'UTF8' TABLESPACE = tbs1; ....
> --------------------
>
> Why pg_dumpall is stating that my template db is template0 and not template1 ? Is there any way to check what db
> (template0 or template1 ) was actually used a template when creating world2 db ? I am having the same problem with all
> my databases
Why exactly is this a problem? Everything that you might have manually added to template1 is now part
of world3 anyway, and therfore included in the dump of world3. When recreating world3 from the dump,
starting from an completly empty database (template0) makes sense for me - otherwise you'd get lots
of "... already exists" error, because pg_dump would try to restore some objects which already exist in
the newly created world3-version, because they were (again!) inherited from template1.
greetings, Florian Pflug
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Ribe | 2006-04-11 16:55:16 | Re: sound index |
Previous Message | Gaetano Mendola | 2006-04-11 16:31:43 | RH9 postgresql 8.0.7 rpm |