Re: Fixing the loss of 'template1' - Mailing list pgsql-general

From Gary Chambers
Subject Re: Fixing the loss of 'template1'
Date
Msg-id alpine.OSX.2.01.1203070946100.2542@localhost
Whole thread Raw
In response to Re: Fixing the loss of 'template1'  (Marti Raudsepp <marti@juffo.org>)
List pgsql-general
Marti,

> As far as I can tell, the only way to remove the template1 database is to
> rename it.

Templates are databases with the datistemplate column set to true.  A
superuser can:

UPDATE pg_database SET datistemplate=false where datname='blah';
DROP DATABASE blah;

As far as Pg is concerned, there is no problem with removing the template1
or postgres databases.  That is not (or may not be) the case for some
utilities and Linux distributions out there that expect them to exist where
used as defaults.  I haven't yet tried removing template0.

--
Gary Chambers

pgsql-general by date:

Previous
From: Marti Raudsepp
Date:
Subject: Re: Fixing the loss of 'template1'
Next
From: Andy Colson
Date:
Subject: rounding a timestamp to nearest x seconds