avoid transaction for CREATE and DROP database
This commit is contained in:
parent
0b1249ed5d
commit
0ddf72b323
1 changed files with 16 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue