Re: drop database / create database / data still here ? - Mailing list pgsql-admin

From Scott Marlowe
Subject Re: drop database / create database / data still here ?
Date
Msg-id p2rdcc563d11004200906rbb042267udd9eae424ff76085@mail.gmail.com
Whole thread Raw
In response to drop database / create database / data still here ?  (Mitch Collinsworth <mitch@ccmr.cornell.edu>)
Responses Re: drop database / create database / data still here ?
List pgsql-admin
On Tue, Apr 13, 2010 at 12:16 PM, Mitch Collinsworth
<mitch@ccmr.cornell.edu> wrote:
>
> Hi Folks,
>
> I thought I understood how this worked, but now it's baffling me.
> I want to drop a database named coral from my test server and load
> a fresh dump of it from my production server.  This has worked when
> I've done it before, but now it's giving me fits.  Here's an
> example:
>
> coral=# \c postgres
> You are now connected to database "postgres".
> postgres=# drop database coral;
> DROP DATABASE
> postgres=# create database coral;
> CREATE DATABASE
> postgres=# \c coral
> You are now connected to database "coral".
> coral=# \dt *.*
>                           List of relations
>       Schema       |              Name              | Type  |  Owner
> --------------------+--------------------------------+-------+----------
>  accmgr             | acct_rate                      | table | accmgr
>  accmgr             | acct_rate_working              | table | accmgr
>  accmgr             | acct_sum                       | table | accmgr
>  accmgr             | acct_sum_raw                   | table | accmgr

I'm pretty sure that at some time you accidentally created those
tables in template1 and now you're getting them every time you create
a database.  Clean out template1 and things should be ok.

pgsql-admin by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: pg_restore -j
Next
From: Scott Marlowe
Date:
Subject: Re: drop database / create database / data still here ?