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

Re: [INTERFACES] destroydb and createdb

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tim Kane <timk(at)hotgames(dot)com>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] destroydb and createdb
Date: 2000-02-09 07:57:53
Message-ID: 4878.950083073@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
Tim Kane <timk(at)hotgames(dot)com> writes:
> I've been doing a heck of a lot of createdb and destroydb 'ing of
> late.....

> All of a sudden...  When I destroy my database, and recreate it...  It
> still retains some of the tables, indexes and sequences.....
> Even when I drop the tables, destroy the db, and recreate the db...
> Those specific tables, indexes and sequences are recreated with the
> database... Along with the data within those tables.

"createdb" actually consists of cloning whatever is in the template1
database (which is why it's called a template).  I'll bet you got
confused at some point and created some user tables in template1
instead of where you intended to.  Now they get cloned into new user
databases.  This behavior is often construed as a feature, since
it does have its uses if you know what you're doing.

If you need to get back to a pristine state, wipe your whole
installation and initdb (after making a pg_dump backup of course!);
or you can try to clean out the cruft in template1.

			regards, tom lane

In response to

pgsql-interfaces by date

Next:From: Ivo SimicevicDate: 2000-02-09 09:33:35
Subject: Re: [INTERFACES] destroydb and createdb
Previous:From: Tim KaneDate: 2000-02-09 07:20:26
Subject: destroydb and createdb

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