Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 1EAA1636B7D for ; Tue, 20 Apr 2010 13:19:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 95646-05-5 for ; Tue, 20 Apr 2010 16:19:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id 74D07634BFA for ; Tue, 20 Apr 2010 12:25:08 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id o3KFP7p20556; Tue, 20 Apr 2010 11:25:07 -0400 (EDT) From: Bruce Momjian Message-Id: <201004201525.o3KFP7p20556@momjian.us> Subject: Re: drop database / create database / data still here ? In-Reply-To: To: Mitch Collinsworth Date: Tue, 20 Apr 2010 11:25:07 -0400 (EDT) CC: pgsql-admin@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/280 X-Sequence-Number: 34374 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 http://momjian.us EnterpriseDB http://enterprisedb.com