Re: How can I recreate the template0 database?

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
Cc: Eduardo Mambrilla Martínez <emambr(at)tid(dot)es>, pgsql-admin(at)postgresql(dot)org
Subject: Re: How can I recreate the template0 database?
Date: 2005-03-14 20:03:36
Message-ID: 20050314200335.GD32097@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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[(at)]dcc(dot)uchile(dot)cl>)
"El número de instalaciones de UNIX se ha elevado a 10,
y se espera que este número aumente" (UPM, 1972)

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Gordon A. Fox 2005-03-14 23:43:20 Fixing "old version was found" error
Previous Message Scott Marlowe 2005-03-14 18:32:53 Re: Performance problem...