From: Guillaume Lelarge <guillaume@lelarge.info>
To: Mitch Collinsworth <mitch@ccmr.cornell.edu>
Cc: pgsql-admin@postgresql.org
Subject: Re: drop database / create database / data still here ?
Date: Tue, 20 Apr 2010 18:00:12 +0200
Message-ID: <4BCDCF8C.9030306@lelarge.info> (raw)
In-Reply-To: <Pine.LNX.4.62.1004131409580.4362@siamese.ccmr.cornell.edu>
References: <Pine.LNX.4.62.1004131409580.4362@siamese.ccmr.cornell.edu>
Le 13/04/2010 20:16, Mitch Collinsworth a écrit :
> [...]
> 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
> accmgr | acct_sum_whatif | table | accmgr
> accmgr | acct_sum_working | table | accmgr
> accmgr | acct_temp | table | accmgr
> accmgr | eq_rate | table | accmgr
> accmgr | eq_rate_working | table | accmgr
> accmgr | inventory_rate | table | accmgr
> accmgr | inventory_rate_working | table | accmgr
> accmgr | inventory_surcharge | table | accmgr
> ...
> (115 rows)
>
> And likewise, select will pull up data from what I thought was a
> brand new, empty database. The coral server was stopped before I
> did this so there should have been no active connections at the
> time.
>
> This is with:
>
> PostgreSQL 8.1.18 on x86_64-redhat-linux-gnu, compiled by GCC gcc (GCC)
> 4.1.2 20080704 (Red Hat 4.1.2-46)
>
The only reason I found is that the template1 database already have
these objects. Can you connect to template1 and try \dt ?
--
Guillaume.
http://www.postgresqlfr.orghttp://dalibo.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: guillaume@lelarge.info, mitch@ccmr.cornell.edu
Subject: Re: drop database / create database / data still here ?
In-Reply-To: <4BCDCF8C.9030306@lelarge.info>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox