pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
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 11:25:07 -0400 (EDT)
Message-ID: <201004201525.o3KFP7p20556@momjian.us> (raw)
In-Reply-To: <Pine.LNX.4.62.1004131409580.4362@siamese.ccmr.cornell.edu>

Mitch Collinsworth 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 *.*

The problem is that you have created these tables in the 'template1'
database, and they are getting copied from there everytime you create a
new database.  FYI, you can also use another database as the template
database if you wish.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com



view thread (7+ messages)  latest in thread

Message-ID: <201004201525.o3KFP7p20556@momjian.us>
Permalink:  ../201004201525.o3KFP7p20556@momjian.us/
Also on:    postgresql.org/message-id/201004201525.o3KFP7p20556@momjian.us

 · 

reply

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: bruce@momjian.us, mitch@ccmr.cornell.edu
  Subject: Re: drop database / create database / data still here ?
  In-Reply-To: <201004201525.o3KFP7p20556@momjian.us>

* 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