Re: restoring template1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Roy Cabaniss <rcaban(at)cabanisspc(dot)uamont(dot)edu>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: restoring template1
Date: 2002-02-14 15:16:53
Message-ID: 8697.1013699813@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Roy Cabaniss <rcaban(at)cabanisspc(dot)uamont(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2002-02-14 15:34:17 Re: Useless index
Previous Message Brian McCane 2002-02-14 15:15:45 Re: Useless index