@@ -575,10 +575,10 @@ drop function inverse(int);
575
575
-- performed in the aborted subtransaction
576
576
begin;
577
577
savepoint x;
578
- create tableabc (a int);
579
- insert intoabc values (5);
580
- insert intoabc values (10);
581
- declare foo cursor for select * fromabc ;
578
+ create tabletrans_abc (a int);
579
+ insert intotrans_abc values (5);
580
+ insert intotrans_abc values (10);
581
+ declare foo cursor for select * fromtrans_abc ;
582
582
fetch from foo;
583
583
a
584
584
---
@@ -591,11 +591,11 @@ fetch from foo;
591
591
ERROR: cursor "foo" does not exist
592
592
commit;
593
593
begin;
594
- create tableabc (a int);
595
- insert intoabc values (5);
596
- insert intoabc values (10);
597
- insert intoabc values (15);
598
- declare foo cursor for select * fromabc ;
594
+ create tabletrans_abc (a int);
595
+ insert intotrans_abc values (5);
596
+ insert intotrans_abc values (10);
597
+ insert intotrans_abc values (15);
598
+ declare foo cursor for select * fromtrans_abc ;
599
599
fetch from foo;
600
600
a
601
601
---
@@ -664,7 +664,7 @@ COMMIT;
664
664
DROP FUNCTION create_temp_tab();
665
665
DROP FUNCTION invert(x float8);
666
666
-- Tests for AND CHAIN
667
- CREATE TABLEabc (a int);
667
+ CREATE TABLEtrans_abc (a int);
668
668
-- set nondefault value so we have something to override below
669
669
SET default_transaction_read_only = on;
670
670
START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
@@ -686,8 +686,8 @@ SHOW transaction_deferrable;
686
686
on
687
687
(1 row)
688
688
689
- INSERT INTOabc VALUES (1);
690
- INSERT INTOabc VALUES (2);
689
+ INSERT INTOtrans_abc VALUES (1);
690
+ INSERT INTOtrans_abc VALUES (2);
691
691
COMMIT AND CHAIN; -- TBLOCK_END
692
692
SHOW transaction_isolation;
693
693
transaction_isolation
@@ -707,11 +707,11 @@ SHOW transaction_deferrable;
707
707
on
708
708
(1 row)
709
709
710
- INSERT INTOabc VALUES ('error');
710
+ INSERT INTOtrans_abc VALUES ('error');
711
711
ERROR: invalid input syntax for type integer: "error"
712
- LINE 1: INSERT INTOabc VALUES ('error');
713
- ^
714
- INSERT INTOabc VALUES (3); -- check it's really aborted
712
+ LINE 1: INSERT INTOtrans_abc VALUES ('error');
713
+ ^
714
+ INSERT INTOtrans_abc VALUES (3); -- check it's really aborted
715
715
ERROR: current transaction is aborted, commands ignored until end of transaction block
716
716
COMMIT AND CHAIN; -- TBLOCK_ABORT_END
717
717
SHOW transaction_isolation;
@@ -732,7 +732,7 @@ SHOW transaction_deferrable;
732
732
on
733
733
(1 row)
734
734
735
- INSERT INTOabc VALUES (4);
735
+ INSERT INTOtrans_abc VALUES (4);
736
736
COMMIT;
737
737
START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
738
738
SHOW transaction_isolation;
@@ -754,10 +754,10 @@ SHOW transaction_deferrable;
754
754
(1 row)
755
755
756
756
SAVEPOINT x;
757
- INSERT INTOabc VALUES ('error');
757
+ INSERT INTOtrans_abc VALUES ('error');
758
758
ERROR: invalid input syntax for type integer: "error"
759
- LINE 1: INSERT INTOabc VALUES ('error');
760
- ^
759
+ LINE 1: INSERT INTOtrans_abc VALUES ('error');
760
+ ^
761
761
COMMIT AND CHAIN; -- TBLOCK_ABORT_PENDING
762
762
SHOW transaction_isolation;
763
763
transaction_isolation
@@ -777,7 +777,7 @@ SHOW transaction_deferrable;
777
777
on
778
778
(1 row)
779
779
780
- INSERT INTOabc VALUES (5);
780
+ INSERT INTOtrans_abc VALUES (5);
781
781
COMMIT;
782
782
START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
783
783
SHOW transaction_isolation;
@@ -839,7 +839,7 @@ SHOW transaction_deferrable;
839
839
off
840
840
(1 row)
841
841
842
- INSERT INTOabc VALUES (6);
842
+ INSERT INTOtrans_abc VALUES (6);
843
843
ROLLBACK AND CHAIN; -- TBLOCK_ABORT_PENDING
844
844
SHOW transaction_isolation;
845
845
transaction_isolation
@@ -859,10 +859,10 @@ SHOW transaction_deferrable;
859
859
off
860
860
(1 row)
861
861
862
- INSERT INTOabc VALUES ('error');
862
+ INSERT INTOtrans_abc VALUES ('error');
863
863
ERROR: invalid input syntax for type integer: "error"
864
- LINE 1: INSERT INTOabc VALUES ('error');
865
- ^
864
+ LINE 1: INSERT INTOtrans_abc VALUES ('error');
865
+ ^
866
866
ROLLBACK AND CHAIN; -- TBLOCK_ABORT_END
867
867
SHOW transaction_isolation;
868
868
transaction_isolation
@@ -888,7 +888,7 @@ COMMIT AND CHAIN; -- error
888
888
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
889
889
ROLLBACK AND CHAIN; -- error
890
890
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
891
- SELECT * FROMabc ORDER BY 1;
891
+ SELECT * FROMtrans_abc ORDER BY 1;
892
892
a
893
893
---
894
894
1
@@ -898,7 +898,7 @@ SELECT * FROM abc ORDER BY 1;
898
898
(4 rows)
899
899
900
900
RESET default_transaction_read_only;
901
- DROP TABLEabc ;
901
+ DROP TABLEtrans_abc ;
902
902
-- Test assorted behaviors around the implicit transaction block created
903
903
-- when multiple SQL commands are sent in a single Query message. These
904
904
-- tests rely on the fact that psql will not break SQL commands apart at a
@@ -1056,29 +1056,29 @@ SHOW transaction_read_only;
1056
1056
off
1057
1057
(1 row)
1058
1058
1059
- CREATE TABLEabc (a int);
1059
+ CREATE TABLEtrans_abc (a int);
1060
1060
-- COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
1061
- INSERT INTOabc VALUES (7)\; COMMIT\; INSERT INTOabc VALUES (8)\; COMMIT AND CHAIN; -- 7 commit, 8 error
1061
+ INSERT INTOtrans_abc VALUES (7)\; COMMIT\; INSERT INTOtrans_abc VALUES (8)\; COMMIT AND CHAIN; -- 7 commit, 8 error
1062
1062
WARNING: there is no transaction in progress
1063
1063
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1064
- INSERT INTOabc VALUES (9)\; ROLLBACK\; INSERT INTOabc VALUES (10)\; ROLLBACK AND CHAIN; -- 9 rollback, 10 error
1064
+ INSERT INTOtrans_abc VALUES (9)\; ROLLBACK\; INSERT INTOtrans_abc VALUES (10)\; ROLLBACK AND CHAIN; -- 9 rollback, 10 error
1065
1065
WARNING: there is no transaction in progress
1066
1066
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
1067
1067
-- COMMIT/ROLLBACK AND CHAIN + COMMIT/ROLLBACK
1068
- INSERT INTOabc VALUES (11)\; COMMIT AND CHAIN\; INSERT INTOabc VALUES (12)\; COMMIT; -- 11 error, 12 not reached
1068
+ INSERT INTOtrans_abc VALUES (11)\; COMMIT AND CHAIN\; INSERT INTOtrans_abc VALUES (12)\; COMMIT; -- 11 error, 12 not reached
1069
1069
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1070
- INSERT INTOabc VALUES (13)\; ROLLBACK AND CHAIN\; INSERT INTOabc VALUES (14)\; ROLLBACK; -- 13 error, 14 not reached
1070
+ INSERT INTOtrans_abc VALUES (13)\; ROLLBACK AND CHAIN\; INSERT INTOtrans_abc VALUES (14)\; ROLLBACK; -- 13 error, 14 not reached
1071
1071
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
1072
1072
-- START TRANSACTION + COMMIT/ROLLBACK AND CHAIN
1073
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOabc VALUES (15)\; COMMIT AND CHAIN; -- 15 ok
1073
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOtrans_abc VALUES (15)\; COMMIT AND CHAIN; -- 15 ok
1074
1074
SHOW transaction_isolation; -- transaction is active at this point
1075
1075
transaction_isolation
1076
1076
-----------------------
1077
1077
repeatable read
1078
1078
(1 row)
1079
1079
1080
1080
COMMIT;
1081
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOabc VALUES (16)\; ROLLBACK AND CHAIN; -- 16 ok
1081
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOtrans_abc VALUES (16)\; ROLLBACK AND CHAIN; -- 16 ok
1082
1082
SHOW transaction_isolation; -- transaction is active at this point
1083
1083
transaction_isolation
1084
1084
-----------------------
@@ -1088,15 +1088,15 @@ SHOW transaction_isolation; -- transaction is active at this point
1088
1088
ROLLBACK;
1089
1089
SET default_transaction_isolation = 'read committed';
1090
1090
-- START TRANSACTION + COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
1091
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOabc VALUES (17)\; COMMIT\; INSERT INTOabc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
1091
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOtrans_abc VALUES (17)\; COMMIT\; INSERT INTOtrans_abc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
1092
1092
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1093
1093
SHOW transaction_isolation; -- out of transaction block
1094
1094
transaction_isolation
1095
1095
-----------------------
1096
1096
read committed
1097
1097
(1 row)
1098
1098
1099
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOabc VALUES (19)\; ROLLBACK\; INSERT INTOabc VALUES (20)\; ROLLBACK AND CHAIN; -- 19 rollback, 20 error
1099
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOtrans_abc VALUES (19)\; ROLLBACK\; INSERT INTOtrans_abc VALUES (20)\; ROLLBACK AND CHAIN; -- 19 rollback, 20 error
1100
1100
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
1101
1101
SHOW transaction_isolation; -- out of transaction block
1102
1102
transaction_isolation
@@ -1105,15 +1105,15 @@ SHOW transaction_isolation; -- out of transaction block
1105
1105
(1 row)
1106
1106
1107
1107
RESET default_transaction_isolation;
1108
- SELECT * FROMabc ORDER BY 1;
1108
+ SELECT * FROMtrans_abc ORDER BY 1;
1109
1109
a
1110
1110
----
1111
1111
7
1112
1112
15
1113
1113
17
1114
1114
(3 rows)
1115
1115
1116
- DROP TABLEabc ;
1116
+ DROP TABLEtrans_abc ;
1117
1117
-- Test for successful cleanup of an aborted transaction at session exit.
1118
1118
-- THIS MUST BE THE LAST TEST IN THIS FILE.
1119
1119
begin;