summaryrefslogtreecommitdiff
path: root/sandbox/trigger-commit-fail.py
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/trigger-commit-fail.py')
-rw-r--r--sandbox/trigger-commit-fail.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/sandbox/trigger-commit-fail.py b/sandbox/trigger-commit-fail.py
index 98b23ae..0655c2f 100644
--- a/sandbox/trigger-commit-fail.py
+++ b/sandbox/trigger-commit-fail.py
@@ -6,7 +6,7 @@ db = psycopg2.connect('dbname=test')
cursor = db.cursor()
-print 'Creating tables and sample data'
+print('Creating tables and sample data')
cursor.execute('''
CREATE TEMPORARY TABLE foo (
@@ -23,22 +23,22 @@ cursor.execute('INSERT INTO bar VALUES (1, 1)')
db.commit()
-print 'Deferring constraint and breaking referential integrity'
+print('Deferring constraint and breaking referential integrity')
cursor.execute('SET CONSTRAINTS bar_foo_fk DEFERRED')
cursor.execute('UPDATE bar SET foo_id = 42 WHERE id = 1')
-print 'Committing (this should fail)'
+print('Committing (this should fail)')
try:
db.commit()
except:
traceback.print_exc()
-print 'Rolling back connection'
+print('Rolling back connection')
db.rollback()
-print 'Running a trivial query'
+print('Running a trivial query')
try:
cursor.execute('SELECT TRUE')
except:
traceback.print_exc()
-print 'db.closed:', db.closed
+print('db.closed:', db.closed)