How can I recreate the template0 database?
How can I recreate the template0 database?
I made a mistake, I droped the template0 database... How can I recreate it? Thanks
Re: How can I recreate the template0 database?
От:
Scott Marlowe <smarlowe@g2switchworks.com>
Дата:
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'; Use CTRL-D to exit.
Re: How can I recreate the template0 database?
От:
Alvaro Herrera <alvherre@dcc.uchile.cl>
Дата:
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 () "El número de instalaciones de UNIX se ha elevado a 10, y se espera que este número aumente" (UPM, 1972)