Re: How can I recreate the template0 database? - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: How can I recreate the template0 database?
Date
Msg-id 20050314200335.GD32097@dcc.uchile.cl
Whole thread Raw
In response to Re: How can I recreate the template0 database?  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-admin
On Mon, Mar 14, 2005 at 09:59:14AM -0600, Scott Marlowe wrote:
> On Wed, 2005-03-09 at 01:32, Eduardo Mambrilla Martínez wrote:
> > I made a mistake, I droped the template0 database...
> > How can I recreate it?
>
> Do you still have template1?  If so, connect in single user mode, enter:
> postgres template1
> create database template0 with template template1
> update pg_database set datallowconn = false where datname='template0';

I think it'd be wise to issue a VACUUM FULL; VACUUM FREEZE in the newly
created template0 before disallowing connections to it.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"El número de instalaciones de UNIX se ha elevado a 10,
y se espera que este número aumente" (UPM, 1972)

pgsql-admin by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Performance problem...
Next
From: "Werner vd Merwe"
Date:
Subject: Re: Performance Question