dbTalk Databases Forums  

[BUGS] V7.4.2: drop database does not drop schemas/table/data

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] V7.4.2: drop database does not drop schemas/table/data in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rachel Willmer
 
Posts: n/a

Default [BUGS] V7.4.2: drop database does not drop schemas/table/data - 05-11-2004 , 01:56 PM






I have a database 'testdb' with two schemas: 'public' and edinburgh'.
Public is empty, everything is in 'edinburgh'.

DROP DATABASE testdb;

Database no longer appears in list of databases in cluster. So far, so good.

CREATE DATABASE testdb;

Database appears again. But so does the schema 'edinburgh', all its
tables, views, data, etc.

From reading the documentation, I thought that "DROP DATABASE" also
deleted all the underlying objects. In which case, this is a bug.

BTW, this is my first post of a postgresql bug. It would be useful if
your page
<http://www.postgresql.org/docs/current/static/bug-reporting.html> had a
link to where the "TODO LIST" and "FAQ" files can be found - it's not
obvious unless you already know!

Thanks
Rachel

PS: System is PostgreSQL 7.4.2 on i686-pc-linux-gnu, compiled by GCC gcc
(GCC) 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3-3-7)


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] V7.4.2: drop database does not drop schemas/table/data - 05-11-2004 , 02:44 PM






Rachel Willmer <rachel (AT) willmer (DOT) com> writes:
Quote:
DROP DATABASE testdb;
CREATE DATABASE testdb;

Database appears again. But so does the schema 'edinburgh', all its
tables, views, data, etc.
Sounds like you created all that stuff in template1, and so it's being
copied into the new database. Read about template databases:
http://www.postgresql.org/docs/7.4/s...mplatedbs.html

If you decide you want to rebuild template1 without re-initdb'ing,
there's a recipe somewhere on the techdocs site --- it's not quite
a trivial thing to do.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #3  
Old   
Rachel Willmer
 
Posts: n/a

Default Re: [BUGS] V7.4.2: drop database does not drop schemas/table/data - 05-16-2004 , 02:14 PM



Tom Lane wrote:

Quote:
Sounds like you created all that stuff in template1, and so it's being
copied into the new database.
Yup, that's it. Thanks!
Rachel

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.