@@ -609,10 +609,10 @@ drop function inverse(int);
609609-- performed in the aborted subtransaction
610610begin;
611611savepoint x;
612- create table abc (a int);
613- insert into abc values (5);
614- insert into abc values (10);
615- declare foo cursor for select * from abc ;
612+ create table trans_abc (a int);
613+ insert into trans_abc values (5);
614+ insert into trans_abc values (10);
615+ declare foo cursor for select * from trans_abc ;
616616fetch from foo;
617617 a
618618---
@@ -625,11 +625,11 @@ fetch from foo;
625625ERROR: cursor "foo" does not exist
626626commit;
627627begin;
628- create table abc (a int);
629- insert into abc values (5);
630- insert into abc values (10);
631- insert into abc values (15);
632- declare foo cursor for select * from abc ;
628+ create table trans_abc (a int);
629+ insert into trans_abc values (5);
630+ insert into trans_abc values (10);
631+ insert into trans_abc values (15);
632+ declare foo cursor for select * from trans_abc ;
633633fetch from foo;
634634 a
635635---
@@ -698,7 +698,7 @@ COMMIT;
698698DROP FUNCTION create_temp_tab();
699699DROP FUNCTION invert(x float8);
700700-- Tests for AND CHAIN
701- CREATE TABLE abc (a int);
701+ CREATE TABLE trans_abc (a int);
702702-- set nondefault value so we have something to override below
703703SET default_transaction_read_only = on;
704704START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
@@ -720,8 +720,8 @@ SHOW transaction_deferrable;
720720 on
721721(1 row)
722722
723- INSERT INTO abc VALUES (1);
724- INSERT INTO abc VALUES (2);
723+ INSERT INTO trans_abc VALUES (1);
724+ INSERT INTO trans_abc VALUES (2);
725725COMMIT AND CHAIN; -- TBLOCK_END
726726SHOW transaction_isolation;
727727 transaction_isolation
@@ -741,11 +741,11 @@ SHOW transaction_deferrable;
741741 on
742742(1 row)
743743
744- INSERT INTO abc VALUES ('error');
744+ INSERT INTO trans_abc VALUES ('error');
745745ERROR: invalid input syntax for type integer: "error"
746- LINE 1: INSERT INTO abc VALUES ('error');
747- ^
748- INSERT INTO abc VALUES (3); -- check it's really aborted
746+ LINE 1: INSERT INTO trans_abc VALUES ('error');
747+ ^
748+ INSERT INTO trans_abc VALUES (3); -- check it's really aborted
749749ERROR: current transaction is aborted, commands ignored until end of transaction block
750750COMMIT AND CHAIN; -- TBLOCK_ABORT_END
751751SHOW transaction_isolation;
@@ -766,7 +766,7 @@ SHOW transaction_deferrable;
766766 on
767767(1 row)
768768
769- INSERT INTO abc VALUES (4);
769+ INSERT INTO trans_abc VALUES (4);
770770COMMIT;
771771START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
772772SHOW transaction_isolation;
@@ -788,10 +788,10 @@ SHOW transaction_deferrable;
788788(1 row)
789789
790790SAVEPOINT x;
791- INSERT INTO abc VALUES ('error');
791+ INSERT INTO trans_abc VALUES ('error');
792792ERROR: invalid input syntax for type integer: "error"
793- LINE 1: INSERT INTO abc VALUES ('error');
794- ^
793+ LINE 1: INSERT INTO trans_abc VALUES ('error');
794+ ^
795795COMMIT AND CHAIN; -- TBLOCK_ABORT_PENDING
796796SHOW transaction_isolation;
797797 transaction_isolation
@@ -811,7 +811,7 @@ SHOW transaction_deferrable;
811811 on
812812(1 row)
813813
814- INSERT INTO abc VALUES (5);
814+ INSERT INTO trans_abc VALUES (5);
815815COMMIT;
816816START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
817817SHOW transaction_isolation;
@@ -873,7 +873,7 @@ SHOW transaction_deferrable;
873873 off
874874(1 row)
875875
876- INSERT INTO abc VALUES (6);
876+ INSERT INTO trans_abc VALUES (6);
877877ROLLBACK AND CHAIN; -- TBLOCK_ABORT_PENDING
878878SHOW transaction_isolation;
879879 transaction_isolation
@@ -893,10 +893,10 @@ SHOW transaction_deferrable;
893893 off
894894(1 row)
895895
896- INSERT INTO abc VALUES ('error');
896+ INSERT INTO trans_abc VALUES ('error');
897897ERROR: invalid input syntax for type integer: "error"
898- LINE 1: INSERT INTO abc VALUES ('error');
899- ^
898+ LINE 1: INSERT INTO trans_abc VALUES ('error');
899+ ^
900900ROLLBACK AND CHAIN; -- TBLOCK_ABORT_END
901901SHOW transaction_isolation;
902902 transaction_isolation
@@ -922,7 +922,7 @@ COMMIT AND CHAIN; -- error
922922ERROR: COMMIT AND CHAIN can only be used in transaction blocks
923923ROLLBACK AND CHAIN; -- error
924924ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
925- SELECT * FROM abc ORDER BY 1;
925+ SELECT * FROM trans_abc ORDER BY 1;
926926 a
927927---
928928 1
@@ -932,7 +932,7 @@ SELECT * FROM abc ORDER BY 1;
932932(4 rows)
933933
934934RESET default_transaction_read_only;
935- DROP TABLE abc ;
935+ DROP TABLE trans_abc ;
936936-- Test assorted behaviors around the implicit transaction block created
937937-- when multiple SQL commands are sent in a single Query message. These
938938-- tests rely on the fact that psql will not break SQL commands apart at a
@@ -1090,29 +1090,29 @@ SHOW transaction_read_only;
10901090 off
10911091(1 row)
10921092
1093- CREATE TABLE abc (a int);
1093+ CREATE TABLE trans_abc (a int);
10941094-- COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
1095- INSERT INTO abc VALUES (7)\; COMMIT\; INSERT INTO abc VALUES (8)\; COMMIT AND CHAIN; -- 7 commit, 8 error
1095+ INSERT INTO trans_abc VALUES (7)\; COMMIT\; INSERT INTO trans_abc VALUES (8)\; COMMIT AND CHAIN; -- 7 commit, 8 error
10961096WARNING: there is no transaction in progress
10971097ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1098- INSERT INTO abc VALUES (9)\; ROLLBACK\; INSERT INTO abc VALUES (10)\; ROLLBACK AND CHAIN; -- 9 rollback, 10 error
1098+ INSERT INTO trans_abc VALUES (9)\; ROLLBACK\; INSERT INTO trans_abc VALUES (10)\; ROLLBACK AND CHAIN; -- 9 rollback, 10 error
10991099WARNING: there is no transaction in progress
11001100ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
11011101-- COMMIT/ROLLBACK AND CHAIN + COMMIT/ROLLBACK
1102- INSERT INTO abc VALUES (11)\; COMMIT AND CHAIN\; INSERT INTO abc VALUES (12)\; COMMIT; -- 11 error, 12 not reached
1102+ INSERT INTO trans_abc VALUES (11)\; COMMIT AND CHAIN\; INSERT INTO trans_abc VALUES (12)\; COMMIT; -- 11 error, 12 not reached
11031103ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1104- INSERT INTO abc VALUES (13)\; ROLLBACK AND CHAIN\; INSERT INTO abc VALUES (14)\; ROLLBACK; -- 13 error, 14 not reached
1104+ INSERT INTO trans_abc VALUES (13)\; ROLLBACK AND CHAIN\; INSERT INTO trans_abc VALUES (14)\; ROLLBACK; -- 13 error, 14 not reached
11051105ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
11061106-- START TRANSACTION + COMMIT/ROLLBACK AND CHAIN
1107- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (15)\; COMMIT AND CHAIN; -- 15 ok
1107+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO trans_abc VALUES (15)\; COMMIT AND CHAIN; -- 15 ok
11081108SHOW transaction_isolation; -- transaction is active at this point
11091109 transaction_isolation
11101110-----------------------
11111111 repeatable read
11121112(1 row)
11131113
11141114COMMIT;
1115- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (16)\; ROLLBACK AND CHAIN; -- 16 ok
1115+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO trans_abc VALUES (16)\; ROLLBACK AND CHAIN; -- 16 ok
11161116SHOW transaction_isolation; -- transaction is active at this point
11171117 transaction_isolation
11181118-----------------------
@@ -1122,15 +1122,15 @@ SHOW transaction_isolation; -- transaction is active at this point
11221122ROLLBACK;
11231123SET default_transaction_isolation = 'read committed';
11241124-- START TRANSACTION + COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
1125- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (17)\; COMMIT\; INSERT INTO abc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
1125+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO trans_abc VALUES (17)\; COMMIT\; INSERT INTO trans_abc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
11261126ERROR: COMMIT AND CHAIN can only be used in transaction blocks
11271127SHOW transaction_isolation; -- out of transaction block
11281128 transaction_isolation
11291129-----------------------
11301130 read committed
11311131(1 row)
11321132
1133- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (19)\; ROLLBACK\; INSERT INTO abc VALUES (20)\; ROLLBACK AND CHAIN; -- 19 rollback, 20 error
1133+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO trans_abc VALUES (19)\; ROLLBACK\; INSERT INTO trans_abc VALUES (20)\; ROLLBACK AND CHAIN; -- 19 rollback, 20 error
11341134ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
11351135SHOW transaction_isolation; -- out of transaction block
11361136 transaction_isolation
@@ -1139,15 +1139,15 @@ SHOW transaction_isolation; -- out of transaction block
11391139(1 row)
11401140
11411141RESET default_transaction_isolation;
1142- SELECT * FROM abc ORDER BY 1;
1142+ SELECT * FROM trans_abc ORDER BY 1;
11431143 a
11441144----
11451145 7
11461146 15
11471147 17
11481148(3 rows)
11491149
1150- DROP TABLE abc ;
1150+ DROP TABLE trans_abc ;
11511151-- Test for successful cleanup of an aborted transaction at session exit.
11521152-- THIS MUST BE THE LAST TEST IN THIS FILE.
11531153begin;
0 commit comments