Thread: Re: [PATCHES] default database creation with initdb

Re: [PATCHES] default database creation with initdb

From
"Dave Page"
Date:

> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 21 June 2005 05:13
> To: Dave Page
> Cc: Andrew Dunstan; Andreas Pflug; Robert Treat; Magnus
> Hagander; pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] [PATCHES] default database creation
> with initdb
>
> "Dave Page" <dpage@vale-housing.co.uk> writes:
> > OK, new patch posted to -patches that updates all the
> utilities as well.
>
> Applied.

Thanks.

> Another point is that Dave added code to pg_dumpall to not dump the
> postgres database.  This seems mistaken to me, so I did not include it
> in the applied patch: if someone is doing real work in postgres then
> they'll be pretty annoyed if it's not backed up.  But perhaps the
> question needs debate.
>
> Any thoughts?

My reading of that code was that I merely stopped it dumping the CREATE
DATABASE statement (and the ACL) for the database, /not/ the actual
contents - in the same way as is done for template1. The theory being
that if you are reloading from into a freshing initdb'ed cluster,
postgres will already exist so doesn't need to be recreated.

Regards, Dave


Re: [PATCHES] default database creation with initdb

From
Tom Lane
Date:
"Dave Page" <dpage@vale-housing.co.uk> writes:
>> Another point is that Dave added code to pg_dumpall to not dump the
>> postgres database.

> My reading of that code was that I merely stopped it dumping the CREATE
> DATABASE statement (and the ACL) for the database, /not/ the actual
> contents - in the same way as is done for template1. The theory being
> that if you are reloading from into a freshing initdb'ed cluster,
> postgres will already exist so doesn't need to be recreated.

D'oh ... you're right of course.  Will fix (and add some comments).

I wonder though if this code isn't a little broken.  It should skip the
CREATE DATABASE certainly, but what about the ACL and dumpDatabaseConfig
parts?  I suspect those got added in at a handy place without enough
thought taken as to whether they should be excluded for template1.
        regards, tom lane