Re: restoring template1 - Mailing list pgsql-admin

From Tom Lane
Subject Re: restoring template1
Date
Msg-id 8697.1013699813@sss.pgh.pa.us
Whole thread Raw
In response to Re: restoring template1  (Roy Cabaniss <rcaban@cabanisspc.uamont.edu>)
List pgsql-admin
Roy Cabaniss <rcaban@cabanisspc.uamont.edu> writes:
> southern=# DROP DATABASE template1;
> ERROR:  DROP DATABASE: database is marked as a template

Sorry about that; but perhaps you should have read the whole section I
pointed you to.  The procedure that would actually work would be
something like (as superuser, from a different database):

regression=# update pg_database set datistemplate = false where datname
regression-# = 'template1';
UPDATE 1
regression=# drop database template1;
DROP DATABASE
regression=# create database template1 with template = template0;
CREATE DATABASE
regression=# update pg_database set datistemplate = true where datname
regression-# = 'template1';
UPDATE 1
regression=#


            regards, tom lane

pgsql-admin by date:

Previous
From: "Florian Helmberger"
Date:
Subject: Re: restoring template1
Next
From: Brian McCane
Date:
Subject: Re: Useless index