Re: documentation vs reality: template databases

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Richard P(dot) Welty" <rwelty(at)averillpark(dot)net>
Cc: Postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: documentation vs reality: template databases
Date: 2007-01-20 15:44:22
Message-ID: 200701201544.l0KFiM827409@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard P. Welty wrote:
> running 8.1 on a fedora core 5 linux box, up to date so far as
> i know.
>
> this page:
>
> http://www.postgresql.org/docs/8.1/interactive/manage-ag-templatedbs.html
>
> says the following:
>
> Note: template1 and template0 do not have any special status beyond
> the fact that the name template1 is the default source database name
> for CREATE DATABASE. For example, one could drop template1 and
> recreate it from template0 without any ill effects. This course of
> action might be advisable if one has carelessly added a bunch of junk
> in template1.
>
> having just carelessly loaded a backup into template1 instead of the
> place i wanted to load it, i had a chance to try to follow this advice:
>
> foo=# drop database template1;
> ERROR: cannnot drop a template database
> foo=#

The comment in the source code says:

/*
* Disallow dropping a DB that is marked istemplate. This is just to
* prevent people from accidentally dropping template0 or template1; they
* can do so if they're really determined ...
*/

I have added a documentaiton mention that 'datistemplate' must be
changed to 'false' to allow deletion. Backpatched to 8.2.X.

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 1.0 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2007-01-20 16:20:58 Re: Help : Microsoft SQL Server equivalents in
Previous Message Mikael Carneholm 2007-01-20 10:21:11 Re: Help : Microsoft SQL Server equivalents in PostGreSQL