Re: Cleaning up template 1 -> template0 cloning

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Thomas Good <tomg(at)admin(dot)nrnet(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Cleaning up template 1 -> template0 cloning
Date: 2002-04-04 01:45:35
Message-ID: web-847066@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thomas, folks,

> 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 and the default database-to-connect-to
> for
> various scripts such as createdb. 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.

Help! The above documentation seems to be incorrect.

If I try to connect to Template0:
psql: FATAL 1: Database "template0" is not currently accepting
connections

If I try to drop template1 from psql:
ERROR: DROP DATABASE: database is marked as a template

If I try "dropdb template1":
ERROR: DROP DATABASE: cannot be executed on the currently open
database
dropdb: database removal failed

Trying to remove template1 to restore it using an undamaged template0
seems to be a catch-22 with no way out. Help!

-Josh Berkus

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-04-04 01:58:28 Re: Cleaning up template 1 -> template0 cloning
Previous Message Bernd von den Brincken 2002-04-04 00:28:18 Rvsd. / Re: Named column in a Function fails at ORDER BY (PgSQL 7.1)