@@ -571,10 +571,10 @@ drop function inverse(int);
571
571
-- performed in the aborted subtransaction
572
572
begin;
573
573
savepoint x;
574
- create tableabc (a int);
575
- insert intoabc values (5);
576
- insert intoabc values (10);
577
- declare foo cursor for select * fromabc ;
574
+ create tabletrans_abc (a int);
575
+ insert intotrans_abc values (5);
576
+ insert intotrans_abc values (10);
577
+ declare foo cursor for select * fromtrans_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 tableabc (a int);
591
- insert intoabc values (5);
592
- insert intoabc values (10);
593
- insert intoabc values (15);
594
- declare foo cursor for select * fromabc ;
590
+ create tabletrans_abc (a int);
591
+ insert intotrans_abc values (5);
592
+ insert intotrans_abc values (10);
593
+ insert intotrans_abc values (15);
594
+ declare foo cursor for select * fromtrans_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 TABLEabc (a int);
663
+ CREATE TABLEtrans_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 INTOabc VALUES (1);
686
- INSERT INTOabc VALUES (2);
685
+ INSERT INTOtrans_abc VALUES (1);
686
+ INSERT INTOtrans_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 INTOabc VALUES ('error');
706
+ INSERT INTOtrans_abc VALUES ('error');
707
707
ERROR: invalid input syntax for type integer: "error"
708
- LINE 1: INSERT INTOabc VALUES ('error');
709
- ^
710
- INSERT INTOabc VALUES (3); -- check it's really aborted
708
+ LINE 1: INSERT INTOtrans_abc VALUES ('error');
709
+ ^
710
+ INSERT INTOtrans_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 INTOabc VALUES (4);
731
+ INSERT INTOtrans_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 INTOabc VALUES ('error');
753
+ INSERT INTOtrans_abc VALUES ('error');
754
754
ERROR: invalid input syntax for type integer: "error"
755
- LINE 1: INSERT INTOabc VALUES ('error');
756
- ^
755
+ LINE 1: INSERT INTOtrans_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 INTOabc VALUES (5);
776
+ INSERT INTOtrans_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 INTOabc VALUES (6);
838
+ INSERT INTOtrans_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 INTOabc VALUES ('error');
858
+ INSERT INTOtrans_abc VALUES ('error');
859
859
ERROR: invalid input syntax for type integer: "error"
860
- LINE 1: INSERT INTOabc VALUES ('error');
861
- ^
860
+ LINE 1: INSERT INTOtrans_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 * FROMabc ORDER BY 1;
887
+ SELECT * FROMtrans_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 TABLEabc ;
897
+ DROP TABLEtrans_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 TABLEabc (a int);
999
+ CREATE TABLEtrans_abc (a int);
1000
1000
-- COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
1001
- INSERT INTOabc VALUES (7)\; COMMIT\; INSERT INTOabc VALUES (8)\; COMMIT AND CHAIN; -- 7 commit, 8 error
1001
+ INSERT INTOtrans_abc VALUES (7)\; COMMIT\; INSERT INTOtrans_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 INTOabc VALUES (9)\; ROLLBACK\; INSERT INTOabc VALUES (10)\; ROLLBACK AND CHAIN; -- 9 rollback, 10 error
1004
+ INSERT INTOtrans_abc VALUES (9)\; ROLLBACK\; INSERT INTOtrans_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 INTOabc VALUES (11)\; COMMIT AND CHAIN\; INSERT INTOabc VALUES (12)\; COMMIT; -- 11 error, 12 not reached
1008
+ INSERT INTOtrans_abc VALUES (11)\; COMMIT AND CHAIN\; INSERT INTOtrans_abc VALUES (12)\; COMMIT; -- 11 error, 12 not reached
1009
1009
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1010
- INSERT INTOabc VALUES (13)\; ROLLBACK AND CHAIN\; INSERT INTOabc VALUES (14)\; ROLLBACK; -- 13 error, 14 not reached
1010
+ INSERT INTOtrans_abc VALUES (13)\; ROLLBACK AND CHAIN\; INSERT INTOtrans_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 INTOabc VALUES (15)\; COMMIT AND CHAIN; -- 15 ok
1013
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOtrans_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 INTOabc VALUES (16)\; ROLLBACK AND CHAIN; -- 16 ok
1021
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOtrans_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
-----------------------
@@ -1027,31 +1027,31 @@ SHOW transaction_isolation; -- transaction is active at this point
1027
1027
1028
1028
ROLLBACK;
1029
1029
-- START TRANSACTION + COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
1030
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOabc VALUES (17)\; COMMIT\; INSERT INTOabc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
1030
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOtrans_abc VALUES (17)\; COMMIT\; INSERT INTOtrans_abc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
1031
1031
ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1032
1032
SHOW transaction_isolation; -- out of transaction block
1033
1033
transaction_isolation
1034
1034
-----------------------
1035
1035
read committed
1036
1036
(1 row)
1037
1037
1038
- START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOabc VALUES (19)\; ROLLBACK\; INSERT INTOabc VALUES (20)\; ROLLBACK AND CHAIN; -- 19 rollback, 20 error
1038
+ START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTOtrans_abc VALUES (19)\; ROLLBACK\; INSERT INTOtrans_abc VALUES (20)\; ROLLBACK AND CHAIN; -- 19 rollback, 20 error
1039
1039
ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
1040
1040
SHOW transaction_isolation; -- out of transaction block
1041
1041
transaction_isolation
1042
1042
-----------------------
1043
1043
read committed
1044
1044
(1 row)
1045
1045
1046
- SELECT * FROMabc ORDER BY 1;
1046
+ SELECT * FROMtrans_abc ORDER BY 1;
1047
1047
a
1048
1048
----
1049
1049
7
1050
1050
15
1051
1051
17
1052
1052
(3 rows)
1053
1053
1054
- DROP TABLEabc ;
1054
+ DROP TABLEtrans_abc ;
1055
1055
-- Test for successful cleanup of an aborted transaction at session exit.
1056
1056
-- THIS MUST BE THE LAST TEST IN THIS FILE.
1057
1057
begin;