[Zope-DB] Postgres - Problem creating new databases
Fri, 08 Nov 2002 11:12:15 +0000
On 8/11/02 11:01 am, "Charlie Clark" <firstname.lastname@example.org> wrote:
> On 2002-11-08 at 11:51:05 [+0100], Andrew Veitch wrote:
>> I'm trying to create new databases from Zope, using psycopg and Postgres.
>> I've tried from ZSQL methods, calling psycopg directly and by
>> os.system("createdb") but I keep getting the same error:
>> ERROR: CREATE DATABASE: may not be called in a transaction block CREATE
>> DATABASE lp
>> If I cut the code out of my product and run it at the python prompt it
>> works fine.
> You need to do this within postgresql, ie. from the command line use psql,
> log in to the database and it should work fine.
Thanks for that, maybe I should have explained in more detail.
The product I'm writing is an Operational Support System for setting up new
customers on our system - so instead of us having to add Zope products
manually, create postgres users, create databases every time a new customer
signs up it'll be done automatically.
I think the problem is that Zope is creating a transaction around what I'm
doing which is pretty useful behaviour generally apart from in this one