Re: Reloading Template1 - Mailing list pgsql-general

From Richard Huxton
Subject Re: Reloading Template1
Date
Msg-id 200401270951.54358.dev@archonet.com
Whole thread Raw
In response to Reloading Template1  (Hadley Willan <hadley.willan@deeperdesign.co.nz>)
Responses Re: Reloading Template1
List pgsql-general
On Tuesday 27 January 2004 08:13, Hadley Willan wrote:
> Hello,
>     I've accidently created a whole bunch of tables and sequences in
> template1.
>
> I didn't actually want the information in template1 but with the slip of
> a key my script piped all the commands into it and now all the info is
> there, doh!.

We all have doh! moments, you are not the first to be here.

> How to I recreate an empty template1?

Two options:
1. Manually undo all the changes (no, didn't think you liked that one)
2. Drop template1 and recreate it using template0

The createdb command has a flag to let you base your new database on something
other than template1. Actually, IIRC this is exactly why we have template0 -
for those occasions where you want to regenerate template1.

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: crlf and copy
Next
From: Richard Huxton
Date:
Subject: Re: Permission Problems:-)?