Open GoogleCodeExporter opened 9 years ago
I had some script to programatically create and destroy in postgresql a long
time
ago, it connected to the 'template1' database cause you cannot have the same
database
open that you want to destroy. Then issued the "DROP DATABASE some_db;" sql
command.
This wasn't with Django btw.
So try it with dbname='template1' instead of settings.DATABASE_NAME and make
sure
that the user your connecting with has the rights to remove the database. (This
is
something i'll never do, the connecting database user for Django should not have
superuser-type rights on the database IMO it's a matter of security)
Some additional information:
http://www.postgresql.org/docs/8.3/interactive/sql-dropdatabase.html
Which states: "DROP DATABASE drops a database. It removes the catalog entries
for the
database and deletes the directory containing the data. It can only be executed
by
the database owner. Also, it cannot be executed while you or anyone else are
connected to the target database. (Connect to postgres or any other database to
issue
this command"
Notes
DROP DATABASE cannot be executed inside a transaction block.
Original comment by v.oostv...@gmail.com
on 4 Nov 2008 at 9:52
fixed in
http://github.com/django-extensions/django-extensions/commit/5b68593daa5a08bd46d
1093545ece7534a5bd755
thanks for the bug report!
Original comment by v.oostv...@gmail.com
on 11 May 2009 at 8:41
You need this patch
[http://django-command-extensions.googlecode.com/issues/attachment?aid=569982265
9788255001&name=path_issues_100.diff
path_issues_100.diff] for revision 196.
Original comment by rodrigopmatias
on 23 Jun 2009 at 4:59
Please supply this patch in English instead of Brazilian.
Also please change the naming of _postgresql_destroy to something more sensible.
thanks!
Original comment by v.oostv...@gmail.com
on 16 Jul 2009 at 10:11
Original issue reported on code.google.com by
wiley.kestner
on 4 Nov 2008 at 3:31Attachments: