avoid transaction for CREATE and DROP database

This commit is contained in:
Jan Dittberner 2015-01-10 17:58:00 +01:00
parent 0b1249ed5d
commit 0ddf72b323

View file

@ -135,7 +135,8 @@ def create_pgsql_database(dbname, username):
"""
with _get_connection() as conn:
with conn.cursor() as curs:
conn.autocommit = True
curs = conn.cursor()
curs.execute(
"""
CREATE DATABASE %(dbname)s OWNER %(username)s
@ -155,7 +156,8 @@ def delete_pgsql_database(dbname):
"""
with _get_connection() as conn:
with conn.cursor() as curs:
conn.autocommit = True
curs = conn.cursor()
curs.execute(
"""
DROP DATABASE %(dbname)s