Re: "create database" not allowed within transaction

"J. Michael Caine" <[email protected]> Mon, 18 Apr 2005 16:45:52 -0700
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
Here's one way to do it, though kludgey:
    cursor.execute('commit') # note that this closes our transaction, so 
that the following works:
    cursor.execute('create database blah')

J. Michael Caine wrote:

> If I attempt to:
>    cursor.execute('create database blah...')
> I get the following error:
>    libpq OperationalError:  ERROR: CREATE DATABASE cannot run inside a 
> transaction block
>
> How can I accomplish my objective?
>



-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728