pypgsql 'create database' problem

From: rdacker(at)pacbell(dot)net (rdack)
To: pgsql-general(at)postgresql(dot)org
Subject: pypgsql 'create database' problem
Date: 2001-10-01 18:48:31
Message-ID: 644f6688.0110011048.51982136@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

from python using PgSQL.
i get:
" libpq.OperationalError: ERROR: CREATE DATABASE: may not be called
in a transaction block"

in a python script i do :
db = PgSQL.connect(database='template1')
cur=db.cursor()
cur.execute("create database tt2")
cur.close()
del db, cur

how does one not be in a transaction block?
what is the correct way to create a db?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Keary Suska 2001-10-01 18:49:23 Re: Extracting time
Previous Message Ana Claudia 2001-10-01 18:35:21 Alter table Add Primary Key