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

Empty database creation???

From: Carol Walter <walterc(at)indiana(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: Empty database creation???
Date: 2008-03-19 21:21:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin

I'm having what I consider a strange problem, although it may be  
caused by my being such a newby to Postgres.  I have been asked to  
send a empty database to a colleague by a researcher.  The first time  
I created it, I didn't realize they want it empty.  I created the  
database and then loaded a file I created with pg_dump.  Then I found  
out that the researcher want to send an empty database.  I dropped  
the database and ran the pg_dump with the flag to only give me the  
schema.  Then I re-created the database and loaded the schema only  
file.  Then I did a select count to make sure the tables were empty,  
but they had their data.  I figured I had made a mistake so went  
through the entire process again and got exactly the same result.   
Then I wondered where the glitch was so I dropped the database then  
recreated it, without restoring the database.  When I looked at the  
database all the tables were there and populated.  Next I dropped the  
database, bailed out of postgres, started psql again recreated the  
database.  The tables were there and populated.  I've even made sure  
the database was dropped by listing the databases.  Still, when I  
recreate it, it comes with all the tables there and populated.  I've  
worked with a lot of databases and everything in my experience says  
that when a database is dropped it's gone.  Why does this come back  
with all the tables intact when I drop it and recreate a database  
with the same name?  Is there a way I can this to work?  I have not  
tried creating the empty database under a name I haven't used, which  
I can do.  It's just that this seems really weird to me.

Carol Walter


pgsql-admin by date

Next:From: Joshua D. DrakeDate: 2008-03-19 21:59:39
Subject: Re: Empty database creation???
Previous:From: Aaron BrownDate: 2008-03-19 19:27:00
Subject: Re: pg_restore failing with "ERROR: out of memory"

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