Re: template0 and template1 databases

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gould <andrewgould(at)yahoo(dot)com>
Cc: "J(dot)H(dot)M(dot) Dassen \(Ray\)" <jdassen(at)cistron(dot)nl>, pgsql-general(at)postgresql(dot)org
Subject: Re: template0 and template1 databases
Date: 2001-09-06 19:42:28
Message-ID: 3759.999805348@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrew Gould <andrewgould(at)yahoo(dot)com> writes:
> Okay, so I don't need to pg_dump the template*
> databases; and I should not dropdb them.

template0 shouldn't need to be dumped, since it's always supposed to be
virgin initdb data. template1 may need to be dumped if you have any
site-local additions in it. pg_dumpall gets these considerations right.

As for dropping, the system won't let you do it unless you go in and
hand-hack pg_database's datistemplate flags. I have actually tested
dropping template1 and recreating it from template0, which I suppose
someone might want to do if they mess up template1 badly enough.
If you drop template0, you no longer have a guaranteed virgin database
to use as a reference, but perhaps that doesn't bother you.

> My scripts aren't anything to brag about; but I think
> newbies (such as myself) may find them useful. Who
> reviews contributions for /contrib?

Send 'em to pgsql-patches, I guess.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ian Harding 2001-09-06 19:56:58 SQL Server to PostgreSQL HOWTO
Previous Message Andrew Gould 2001-09-06 19:35:31 Re: template0 and template1 databases