Saturday, November 6, 2010

postgres CREATE DATABASE from django

Hi everyone

I know what I try to do sounds like something one shouldn't, but I
have my reason [1]...

I want to CREATE DATABASE from django (in a request/response cycle) on
postgres, so I do connections['default'].cursor().execute("CREATE
DATABASE somename"). That gives me a 'CREATE DATABASE cannot run
inside a transaction block' postgres error. Now if I call
leave_transaction_management before I do the query, I get a Django
TransactionManagementError with "This code isn't under transaction
management".

Does anyone have a smart idea how I could solve this?

Jonas


[1] https://github.com/ojii/django-demo

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate