Skip site navigation (1) Skip section navigation (2)

Re: Reloading Template1

From: Richard Huxton <dev(at)archonet(dot)com>
To: Hadley Willan <hadley(dot)willan(at)deeperdesign(dot)co(dot)nz>,PGSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Reloading Template1
Date: 2004-01-27 09:51:54
Message-ID: 200401270951.54358.dev@archonet.com (view raw or flat)
Thread:
Lists: 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

In response to

Responses

pgsql-general by date

Next:From: Richard HuxtonDate: 2004-01-27 10:05:16
Subject: Re: Permission Problems:-)?
Previous:From: Richard HuxtonDate: 2004-01-27 09:45:39
Subject: Re: crlf and copy

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group