Re: Fixing the loss of 'template1' - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Fixing the loss of 'template1'
Date
Msg-id 201203070722.10035.adrian.klaver@gmail.com
Whole thread Raw
In response to Fixing the loss of 'template1'  (Martin Gregorie <martin@gregorie.org>)
List pgsql-general
On Wednesday, March 07, 2012 6:23:42 am Martin Gregorie wrote:

> Question
> ========
> Is it possible to reinstate 'template1' and all its works without
> reinitialising the database from scratch. It was suggested to me that
> running "initdb" might fix it while leaving my data in place though my
> source was uncertain about its success. Would this work or is there a
> better way to restore 'template1' in a populated database system?


Was reading through this again and got to wondering, is pg_dumpall really
necessary? Do you have multiple databases you want to dump at once? If not a
plain pg_dump against a particular database would work. There is also the
advantage that if you use pg_dump -Fc you can use pg_restore. My use case for
pg_dumpall is pg_dumpall -g to get the global information only from the cluster.
I then use pg_dump for individual databases. You would still want to recreate a
template1 because quite a few tools expect it to be there.



--
Adrian Klaver
adrian.klaver@gmail.com

pgsql-general by date:

Previous
From: Martin Gregorie
Date:
Subject: Re: Fixing the loss of 'template1'
Next
From: Adrian Klaver
Date:
Subject: Re: Fixing the loss of 'template1'