By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,852 Members | 2,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,852 IT Pros & Developers. It's quick & easy.

DROP DATABASE, but still there

P: n/a
What does it mean when you drop a database and then recreate with the
same name and all the objects are still there. I want to wipe out the db
and put back from pg_restore. After I re-create the db, all the old
tables are back before I run pg_restore.

--
Robert
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Robert Fitzpatrick <ro****@webtent.com> writes:
What does it mean when you drop a database and then recreate with the
same name and all the objects are still there. I want to wipe out the db
and put back from pg_restore. After I re-create the db, all the old
tables are back before I run pg_restore.


Check the 'template1' database to see if the tables got put in there
by mistake at some point.

-Doug

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #2

P: n/a
On Thu, 2004-11-11 at 14:03, Doug McNaught wrote:
Robert Fitzpatrick <ro****@webtent.com> writes:
What does it mean when you drop a database and then recreate with the
same name and all the objects are still there. I want to wipe out the db
and put back from pg_restore. After I re-create the db, all the old
tables are back before I run pg_restore.


Check the 'template1' database to see if the tables got put in there
by mistake at some point.


Yeah, I was just starting to realize that these objects that keep coming
back are in the template1 as well.....any reason why I shouldn't drop
the template1 and re-create like any other?

--
Robert
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #3

P: n/a
On Thu, Nov 11, 2004 at 14:17:45 -0500,
Robert Fitzpatrick <ro****@webtent.com> wrote:
On Thu, 2004-11-11 at 14:03, Doug McNaught wrote:
Robert Fitzpatrick <ro****@webtent.com> writes:
What does it mean when you drop a database and then recreate with the
same name and all the objects are still there. I want to wipe out the db
and put back from pg_restore. After I re-create the db, all the old
tables are back before I run pg_restore.


Check the 'template1' database to see if the tables got put in there
by mistake at some point.


Yeah, I was just starting to realize that these objects that keep coming
back are in the template1 as well.....any reason why I shouldn't drop
the template1 and re-create like any other?


I think you need to use the -T option if you do this to have a copy made
of template0 instead of the default of template1.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #4

P: n/a

Robert Fitzpatrick <ro****@webtent.com> writes:
Yeah, I was just starting to realize that these objects that keep coming
back are in the template1 as well.....any reason why I shouldn't drop
the template1 and re-create like any other?


You can do that but you'll have to do:

CREATE DATABASE template1 WITH template = 'template0'
--
greg
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #5

P: n/a
Greg Stark <gs*****@mit.edu> writes:
Robert Fitzpatrick <ro****@webtent.com> writes:
Yeah, I was just starting to realize that these objects that keep coming
back are in the template1 as well.....any reason why I shouldn't drop
the template1 and re-create like any other?
You can do that but you'll have to do:
CREATE DATABASE template1 WITH template = 'template0'


Also there are several safety interlocks you'll have to defeat, IIRC.
It's not rocket science but I'd recommend consulting the writeup on
techdocs.postgresql.org about the exact process for recreating
template1.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.