@@ -571,10 +571,10 @@ drop function inverse(int);
571
571
-- performed in the aborted subtransaction
572
572
begin;
573
573
savepoint x;
574
- create table abc (a int);
575
- insert into abc values (5);
576
- insert into abc values (10);
577
- declare foo cursor for select * from abc ;
574
+ create table trans_abc (a int);
575
+ insert into trans_abc values (5);
576
+ insert into trans_abc values (10);
577
+ declare foo cursor for select * from trans_abc ;
578
578
fetch from foo;
579
579
a
580
580
---
@@ -587,11 +587,11 @@ fetch from foo;
587
587
ERROR: cursor "foo" does not exist
588
588
commit;
589
589
begin;
590
- create table abc (a int);
591
- insert into abc values (5);
592
- insert into abc values (10);
593
- insert into abc values (15);
594
- declare foo cursor for select * from abc ;
590
+ create table trans_abc (a int);
591
+ insert into trans_abc values (5);
592
+ insert into trans_abc values (10);
593
+ insert into trans_abc values (15);
594
+ declare foo cursor for select * from trans_abc ;
595
595
fetch from foo;
596
596
a
597
597
---
@@ -660,7 +660,7 @@ COMMIT;
660
660
DROP FUNCTION create_temp_tab();
661
661
DROP FUNCTION invert(x float8);
662
662
-- Tests for AND CHAIN
663
- CREATE TABLE abc (a int);
663
+ CREATE TABLE trans_abc (a int);
664
664
-- set nondefault value so we have something to override below
665
665
SET default_transaction_read_only = on;
666
666
START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
@@ -682,8 +682,8 @@ SHOW transaction_deferrable;
682
682
on
683
683
(1 row)
684
684
685
- INSERT INTO abc VALUES (1);
686
- INSERT INTO abc VALUES (2);
685
+ INSERT INTO trans_abc VALUES (1);
686
+ INSERT INTO trans_abc VALUES (2);
687
687
COMMIT AND CHAIN; -- TBLOCK_END
688
688
SHOW transaction_isolation;
689
689
transaction_isolation
@@ -703,11 +703,11 @@ SHOW transaction_deferrable;
703
703
on
704
704
(1 row)
705
705
706
- INSERT INTO abc VALUES ('error');
706
+ INSERT INTO trans_abc VALUES ('error');
707
707
ERROR: invalid input syntax for type integer: "error"
708
- LINE 1: INSERT INTO abc VALUES ('error');
709
- ^
710
- INSERT INTO abc VALUES (3); -- check it's really aborted
708
+ LINE 1: INSERT INTO trans_abc VALUES ('error');
709
+ ^
710
+ INSERT INTO trans_abc VALUES (3); -- check it's really aborted
711
711
ERROR: current transaction is aborted, commands ignored until end of transaction block
712
712
COMMIT AND CHAIN; -- TBLOCK_ABORT_END
713
713
SHOW transaction_isolation;
@@ -728,7 +728,7 @@ SHOW transaction_deferrable;
728
728
on
729
729
(1 row)
730
730
731
- INSERT INTO abc VALUES (4);
731
+ INSERT INTO trans_abc VALUES (4);
732
732
COMMIT;
733
733
START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
734
734
SHOW transaction_isolation;
@@ -750,10 +750,10 @@ SHOW transaction_deferrable;
750
750
(1 row)
751
751
752
752
SAVEPOINT x;
753
- INSERT INTO abc VALUES ('error');
753
+ INSERT INTO trans_abc VALUES ('error');
754
754
ERROR: invalid input syntax for type integer: "error"
755
- LINE 1: INSERT INTO abc VALUES ('error');
756
- ^
755
+ LINE 1: INSERT INTO trans_abc VALUES ('error');
756
+ ^
757
757
COMMIT AND CHAIN; -- TBLOCK_ABORT_PENDING
758
758
SHOW transaction_isolation;
759
759
transaction_isolation
@@ -773,7 +773,7 @@ SHOW transaction_deferrable;
773
773
on
774
774
(1 row)
775
775
776
- INSERT INTO abc VALUES (5);
776
+ INSERT INTO trans_abc VALUES (5);
777
777
COMMIT;
778
778
START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
779
779
SHOW transaction_isolation;
@@ -835,7 +835,7 @@ SHOW transaction_deferrable;
835
835
off
836
836
(1 row)
837
837
838
- INSERT INTO abc VALUES (6);
838
+ INSERT INTO trans_abc VALUES (6);
839
839
ROLLBACK AND CHAIN; -- TBLOCK_ABORT_PENDING
840
840
SHOW transaction_isolation;
841
841
transaction_isolation
@@ -855,10 +855,10 @@ SHOW transaction_deferrable;
855
855
off
856
856
(1 row)
857
857
858
- INSERT INTO abc VALUES ('error');
858
+ INSERT INTO trans_abc VALUES ('error');
859
859
ERROR: invalid input syntax for type integer: "error"
860
- LINE 1: INSERT INTO abc VALUES ('error');
861
- ^
860
+ LINE 1: INSERT INTO trans_abc VALUES ('error');
861
+ ^
862
862
ROLLBACK AND CHAIN; -- TBLOCK_ABORT_END
863
863
SHOW transaction_isolation;
864
864
transaction_isolation
@@ -884,7 +884,7 @@ COMMIT AND CHAIN; -- error
884
884
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
885
885
ROLLBACK AND CHAIN; -- error
886
886
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
887
- SELECT * FROM abc ORDER BY 1;
887
+ SELECT * FROM trans_abc ORDER BY 1;
888
888
a
889
889
---
890
890
1
@@ -894,7 +894,7 @@ SELECT * FROM abc ORDER BY 1;
894
894
(4 rows)
895
895
896
896
RESET default_transaction_read_only;
897
- DROP TABLE abc ;
897
+ DROP TABLE trans_abc ;
898
898
-- Test assorted behaviors around the implicit transaction block created
899
899
-- when multiple SQL commands are sent in a single Query message. These
900
900
-- tests rely on the fact that psql will not break SQL commands apart at a
@@ -996,29 +996,29 @@ SHOW transaction_read_only;
996
996
off
997
997
(1 row)
998
998
999
- CREATE TABLE abc (a int);
999
+ CREATE TABLE trans_abc (a int);
1000
1000
-- COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
1001
- INSERT INTO abc VALUES (7)\; COMMIT\; INSERT INTO abc VALUES (8)\; COMMIT AND CHAIN; -- 7 commit, 8 error
1001
+ INSERT INTO trans_abc VALUES (7)\; COMMIT\; INSERT INTO trans_abc VALUES (8)\; COMMIT AND CHAIN; -- 7 commit, 8 error
1002
1002
WARNING: there is no transaction in progress
1003
1003
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1004
- INSERT INTO abc VALUES (9)\; ROLLBACK\; INSERT INTO abc VALUES (10)\; ROLLBACK AND CHAIN; -- 9 rollback, 10 error
1004
+ INSERT INTO trans_abc VALUES (9)\; ROLLBACK\; INSERT INTO trans_abc VALUES (10)\; ROLLBACK AND CHAIN; -- 9 rollback, 10 error
1005
1005
WARNING: there is no transaction in progress
1006
1006
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
1007
1007
-- COMMIT/ROLLBACK AND CHAIN + COMMIT/ROLLBACK
1008
- INSERT INTO abc VALUES (11)\; COMMIT AND CHAIN\; INSERT INTO abc VALUES (12)\; COMMIT; -- 11 error, 12 not reached
1008
+ INSERT INTO trans_abc VALUES (11)\; COMMIT AND CHAIN\; INSERT INTO trans_abc VALUES (12)\; COMMIT; -- 11 error, 12 not reached
1009
1009
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1010
- INSERT INTO abc VALUES (13)\; ROLLBACK AND CHAIN\; INSERT INTO abc VALUES (14)\; ROLLBACK; -- 13 error, 14 not reached
1010
+ INSERT INTO trans_abc VALUES (13)\; ROLLBACK AND CHAIN\; INSERT INTO trans_abc VALUES (14)\; ROLLBACK; -- 13 error, 14 not reached
1011
1011
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
1012
1012
-- START TRANSACTION + COMMIT/ROLLBACK AND CHAIN
1013
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (15)\; COMMIT AND CHAIN; -- 15 ok
1013
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO trans_abc VALUES (15)\; COMMIT AND CHAIN; -- 15 ok
1014
1014
SHOW transaction_isolation; -- transaction is active at this point
1015
1015
transaction_isolation
1016
1016
-----------------------
1017
1017
repeatable read
1018
1018
(1 row)
1019
1019
1020
1020
COMMIT;
1021
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (16)\; ROLLBACK AND CHAIN; -- 16 ok
1021
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO trans_abc VALUES (16)\; ROLLBACK AND CHAIN; -- 16 ok
1022
1022
SHOW transaction_isolation; -- transaction is active at this point
1023
1023
transaction_isolation
1024
1024
-----------------------
@@ -1028,15 +1028,15 @@ SHOW transaction_isolation; -- transaction is active at this point
1028
1028
ROLLBACK;
1029
1029
SET default_transaction_isolation = 'read committed';
1030
1030
-- START TRANSACTION + COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
1031
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (17)\; COMMIT\; INSERT INTO abc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
1031
+ 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
1032
1032
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1033
1033
SHOW transaction_isolation; -- out of transaction block
1034
1034
transaction_isolation
1035
1035
-----------------------
1036
1036
read committed
1037
1037
(1 row)
1038
1038
1039
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (19)\; ROLLBACK\; INSERT INTO abc VALUES (20)\; ROLLBACK AND CHAIN; -- 19 rollback, 20 error
1039
+ 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
1040
1040
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
1041
1041
SHOW transaction_isolation; -- out of transaction block
1042
1042
transaction_isolation
@@ -1045,15 +1045,15 @@ SHOW transaction_isolation; -- out of transaction block
1045
1045
(1 row)
1046
1046
1047
1047
RESET default_transaction_isolation;
1048
- SELECT * FROM abc ORDER BY 1;
1048
+ SELECT * FROM trans_abc ORDER BY 1;
1049
1049
a
1050
1050
----
1051
1051
7
1052
1052
15
1053
1053
17
1054
1054
(3 rows)
1055
1055
1056
- DROP TABLE abc ;
1056
+ DROP TABLE trans_abc ;
1057
1057
-- Test for successful cleanup of an aborted transaction at session exit.
1058
1058
-- THIS MUST BE THE LAST TEST IN THIS FILE.
1059
1059
begin;
0 commit comments