8 INSERT INTO xacttest (a, b) VALUES (777, 777.777);
10 -- should retrieve one value--
11 SELECT a FROM xacttest WHERE a > 100;
18 CREATE TABLE disappear (a int4);
21 SELECT * FROM aggtest;
28 SELECT oid FROM pg_class WHERE relname = 'disappear';
33 -- should have members again
34 SELECT * FROM aggtest;
44 CREATE TABLE writetest (a int);
45 CREATE TEMPORARY TABLE temptest (a int);
47 SET TRANSACTION ISOLATION LEVEL SERIALIZABLE, READ ONLY, DEFERRABLE; -- ok
48 SELECT * FROM writetest; -- ok
53 SET TRANSACTION READ WRITE; --fail
54 ERROR: transaction read-write mode must be set before any query
57 SET TRANSACTION READ ONLY; -- ok
58 SET TRANSACTION READ WRITE; -- ok
59 SET TRANSACTION READ ONLY; -- ok
60 SELECT * FROM writetest; -- ok
66 SET TRANSACTION READ ONLY; -- ok
67 SELECT * FROM writetest; -- ok
72 SET TRANSACTION READ ONLY; -- ok
73 SET TRANSACTION READ WRITE; --fail
74 ERROR: cannot set transaction read-write mode inside a read-only transaction
77 SET TRANSACTION READ WRITE; -- ok
79 SET TRANSACTION READ WRITE; -- ok
80 SET TRANSACTION READ ONLY; -- ok
81 SELECT * FROM writetest; -- ok
86 SET TRANSACTION READ ONLY; -- ok
87 SET TRANSACTION READ WRITE; --fail
88 ERROR: cannot set transaction read-write mode inside a read-only transaction
91 SET TRANSACTION READ WRITE; -- ok
93 SET TRANSACTION READ ONLY; -- ok
94 SELECT * FROM writetest; -- ok
99 ROLLBACK TO SAVEPOINT x;
100 SHOW transaction_read_only; -- off
101 transaction_read_only
102 -----------------------
107 SET TRANSACTION READ ONLY; -- ok
108 SELECT * FROM writetest; -- ok
114 SHOW transaction_read_only; -- off
115 transaction_read_only
116 -----------------------
121 SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;
122 DROP TABLE writetest; -- fail
123 ERROR: cannot execute DROP TABLE in a read-only transaction
124 INSERT INTO writetest VALUES (1); -- fail
125 ERROR: cannot execute INSERT in a read-only transaction
126 SELECT * FROM writetest; -- ok
131 DELETE FROM temptest; -- ok
132 UPDATE temptest SET a = 0 FROM writetest WHERE temptest.a = 1 AND writetest.a = temptest.a; -- ok
133 PREPARE test AS UPDATE writetest SET a = 0; -- ok
134 EXECUTE test; -- fail
135 ERROR: cannot execute UPDATE in a read-only transaction
136 SELECT * FROM writetest, temptest; -- ok
141 CREATE TABLE test AS SELECT * FROM writetest; -- fail
142 ERROR: cannot execute CREATE TABLE AS in a read-only transaction
143 START TRANSACTION READ WRITE;
144 DROP TABLE writetest; -- ok
146 -- Subtransactions, basic tests
147 -- create & drop tables
148 SET SESSION CHARACTERISTICS AS TRANSACTION READ WRITE;
149 CREATE TABLE trans_foobar (a int);
151 CREATE TABLE trans_foo (a int);
153 DROP TABLE trans_foo;
154 CREATE TABLE trans_bar (a int);
155 ROLLBACK TO SAVEPOINT one;
156 RELEASE SAVEPOINT one;
158 CREATE TABLE trans_baz (a int);
159 RELEASE SAVEPOINT two;
160 drop TABLE trans_foobar;
161 CREATE TABLE trans_barbaz (a int);
163 -- should exist: trans_barbaz, trans_baz, trans_foo
164 SELECT * FROM trans_foo; -- should be empty
169 SELECT * FROM trans_bar; -- shouldn't exist
170 ERROR: relation "trans_bar" does not exist
171 LINE 1: SELECT * FROM trans_bar;
173 SELECT * FROM trans_barbaz; -- should be empty
178 SELECT * FROM trans_baz; -- should be empty
185 INSERT INTO trans_foo VALUES (1);
187 INSERT into trans_bar VALUES (1);
188 ERROR: relation "trans_bar" does not exist
189 LINE 1: INSERT into trans_bar VALUES (1);
192 RELEASE SAVEPOINT one;
194 INSERT into trans_barbaz VALUES (1);
198 INSERT INTO trans_foo VALUES (2);
199 RELEASE SAVEPOINT four;
200 ROLLBACK TO SAVEPOINT three;
201 RELEASE SAVEPOINT three;
202 INSERT INTO trans_foo VALUES (3);
204 SELECT * FROM trans_foo; -- should have 1 and 3
211 SELECT * FROM trans_barbaz; -- should have 1
217 -- test whole-tree commit
221 ERROR: column "trans_foo" does not exist
222 LINE 1: SELECT trans_foo;
224 ROLLBACK TO SAVEPOINT one;
225 RELEASE SAVEPOINT one;
227 CREATE TABLE savepoints (a int);
229 INSERT INTO savepoints VALUES (1);
231 INSERT INTO savepoints VALUES (2);
233 INSERT INTO savepoints VALUES (3);
234 ROLLBACK TO SAVEPOINT five;
236 COMMIT; -- should not be in a transaction block
237 WARNING: there is no transaction in progress
238 SELECT * FROM savepoints;
245 -- test whole-tree rollback
248 DELETE FROM savepoints WHERE a=1;
249 RELEASE SAVEPOINT one;
251 DELETE FROM savepoints WHERE a=1;
253 DELETE FROM savepoints WHERE a=2;
255 COMMIT; -- should not be in a transaction block
256 WARNING: there is no transaction in progress
257 SELECT * FROM savepoints;
264 -- test whole-tree commit on an aborted subtransaction
266 INSERT INTO savepoints VALUES (4);
268 INSERT INTO savepoints VALUES (5);
270 ERROR: column "trans_foo" does not exist
271 LINE 1: SELECT trans_foo;
274 SELECT * FROM savepoints;
282 INSERT INTO savepoints VALUES (6);
284 INSERT INTO savepoints VALUES (7);
285 RELEASE SAVEPOINT one;
286 INSERT INTO savepoints VALUES (8);
288 -- rows 6 and 8 should have been created by the same xact
289 SELECT a.xmin = b.xmin FROM savepoints a, savepoints b WHERE a.a=6 AND b.a=8;
295 -- rows 6 and 7 should have been created by different xacts
296 SELECT a.xmin = b.xmin FROM savepoints a, savepoints b WHERE a.a=6 AND b.a=7;
303 INSERT INTO savepoints VALUES (9);
305 INSERT INTO savepoints VALUES (10);
306 ROLLBACK TO SAVEPOINT one;
307 INSERT INTO savepoints VALUES (11);
309 SELECT a FROM savepoints WHERE a in (9, 10, 11);
316 -- rows 9 and 11 should have been created by different xacts
317 SELECT a.xmin = b.xmin FROM savepoints a, savepoints b WHERE a.a=9 AND b.a=11;
324 INSERT INTO savepoints VALUES (12);
326 INSERT INTO savepoints VALUES (13);
328 INSERT INTO savepoints VALUES (14);
329 ROLLBACK TO SAVEPOINT one;
330 INSERT INTO savepoints VALUES (15);
332 INSERT INTO savepoints VALUES (16);
334 INSERT INTO savepoints VALUES (17);
336 SELECT a FROM savepoints WHERE a BETWEEN 12 AND 17;
346 INSERT INTO savepoints VALUES (18);
348 INSERT INTO savepoints VALUES (19);
350 INSERT INTO savepoints VALUES (20);
351 ROLLBACK TO SAVEPOINT one;
352 INSERT INTO savepoints VALUES (21);
353 ROLLBACK TO SAVEPOINT one;
354 INSERT INTO savepoints VALUES (22);
356 SELECT a FROM savepoints WHERE a BETWEEN 18 AND 22;
363 DROP TABLE savepoints;
364 -- only in a transaction block:
366 ERROR: SAVEPOINT can only be used in transaction blocks
367 ROLLBACK TO SAVEPOINT one;
368 ERROR: ROLLBACK TO SAVEPOINT can only be used in transaction blocks
369 RELEASE SAVEPOINT one;
370 ERROR: RELEASE SAVEPOINT can only be used in transaction blocks
371 -- Only "rollback to" allowed in aborted state
375 ERROR: division by zero
376 SAVEPOINT two; -- ignored till the end of ...
377 ERROR: current transaction is aborted, commands ignored until end of transaction block
378 RELEASE SAVEPOINT one; -- ignored till the end of ...
379 ERROR: current transaction is aborted, commands ignored until end of transaction block
380 ROLLBACK TO SAVEPOINT one;
388 SELECT 1; -- this should work
394 -- check non-transactional behavior of cursors
396 DECLARE c CURSOR FOR SELECT unique2 FROM tenk1 ORDER BY unique2;
413 ROLLBACK TO SAVEPOINT one;
429 RELEASE SAVEPOINT one;
446 DECLARE c CURSOR FOR SELECT unique2/0 FROM tenk1 ORDER BY unique2;
449 ERROR: division by zero
450 ROLLBACK TO SAVEPOINT two;
451 -- c is now dead to the world ...
453 ERROR: portal "c" cannot be run
454 ROLLBACK TO SAVEPOINT two;
455 RELEASE SAVEPOINT two;
457 ERROR: portal "c" cannot be run
460 -- Check that "stable" functions are really stable. They should not be
461 -- able to see the partial results of the calling query. (Ideally we would
462 -- also check that they don't see commits of concurrent transactions, but
463 -- that's a mite hard to do within the limitations of pg_regress.)
465 select * from xacttest;
475 create or replace function max_xacttest() returns smallint language sql as
476 'select max(a) from xacttest' stable;
478 update xacttest set a = max_xacttest() + 10 where a > 0;
479 select * from xacttest;
490 -- But a volatile function can see the partial results of the calling query
491 create or replace function max_xacttest() returns smallint language sql as
492 'select max(a) from xacttest' volatile;
494 update xacttest set a = max_xacttest() + 10 where a > 0;
495 select * from xacttest;
506 -- Now the same test with plpgsql (since it depends on SPI which is different)
507 create or replace function max_xacttest() returns smallint language plpgsql as
508 'begin return max(a) from xacttest; end' stable;
510 update xacttest set a = max_xacttest() + 10 where a > 0;
511 select * from xacttest;
522 create or replace function max_xacttest() returns smallint language plpgsql as
523 'begin return max(a) from xacttest; end' volatile;
525 update xacttest set a = max_xacttest() + 10 where a > 0;
526 select * from xacttest;
537 -- test case for problems with dropping an open relation during abort
540 CREATE TABLE koju (a INT UNIQUE);
541 INSERT INTO koju VALUES (1);
542 INSERT INTO koju VALUES (1);
543 ERROR: duplicate key value violates unique constraint "koju_a_key"
544 DETAIL: Key (a)=(1) already exists.
546 CREATE TABLE koju (a INT UNIQUE);
547 INSERT INTO koju VALUES (1);
548 INSERT INTO koju VALUES (1);
549 ERROR: duplicate key value violates unique constraint "koju_a_key"
550 DETAIL: Key (a)=(1) already exists.
552 DROP TABLE trans_foo;
553 DROP TABLE trans_baz;
554 DROP TABLE trans_barbaz;
555 -- test case for problems with revalidating an open relation during abort
556 create function inverse(int) returns float8 as
559 analyze revalidate_bug;
562 when division_by_zero then return 0;
563 end$$ language plpgsql volatile;
564 create table revalidate_bug (c float8 unique);
565 insert into revalidate_bug values (1);
566 insert into revalidate_bug values (inverse(0));
567 drop table revalidate_bug;
568 drop function inverse(int);
569 -- verify that cursors created during an aborted subtransaction are
570 -- closed, but that we do not rollback the effect of any FETCHs
571 -- performed in the aborted subtransaction
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;
587 ERROR: cursor "foo" does not exist
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;
616 -- Test for proper cleanup after a failure in a cursor portal
617 -- that was created in an outer subtransaction
618 CREATE FUNCTION invert(x float8) RETURNS float8 LANGUAGE plpgsql AS
619 $$ begin return 1/x; end $$;
620 CREATE FUNCTION create_temp_tab() RETURNS text
621 LANGUAGE plpgsql AS $$
623 CREATE TEMP TABLE new_table (f1 float8);
624 -- case of interest is that we fail while holding an open
625 -- relcache reference to new_table
626 INSERT INTO new_table SELECT invert(0.0);
630 DECLARE ok CURSOR FOR SELECT * FROM int8_tbl;
631 DECLARE ctt CURSOR FOR SELECT create_temp_tab();
639 FETCH ok; -- should work
641 -----+------------------
642 123 | 4567890123456789
645 FETCH ctt; -- error occurs here
646 ERROR: division by zero
647 CONTEXT: PL/pgSQL function invert(double precision) line 1 at RETURN
648 SQL statement "INSERT INTO new_table SELECT invert(0.0)"
649 PL/pgSQL function create_temp_tab() line 6 at SQL statement
651 FETCH ok; -- should work
653 ------------------+-----
654 4567890123456789 | 123
657 FETCH ctt; -- must be rejected
658 ERROR: portal "ctt" cannot be run
660 DROP FUNCTION create_temp_tab();
661 DROP FUNCTION invert(x float8);
662 -- Tests for AND CHAIN
663 CREATE TABLE abc (a int);
664 -- set nondefault value so we have something to override below
665 SET default_transaction_read_only = on;
666 START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
667 SHOW transaction_isolation;
668 transaction_isolation
669 -----------------------
673 SHOW transaction_read_only;
674 transaction_read_only
675 -----------------------
679 SHOW transaction_deferrable;
680 transaction_deferrable
681 ------------------------
685 INSERT INTO abc VALUES (1);
686 INSERT INTO abc VALUES (2);
687 COMMIT AND CHAIN; -- TBLOCK_END
688 SHOW transaction_isolation;
689 transaction_isolation
690 -----------------------
694 SHOW transaction_read_only;
695 transaction_read_only
696 -----------------------
700 SHOW transaction_deferrable;
701 transaction_deferrable
702 ------------------------
706 INSERT INTO abc VALUES ('error');
707 ERROR: invalid input syntax for type integer: "error"
708 LINE 1: INSERT INTO abc VALUES ('error');
710 INSERT INTO abc VALUES (3); -- check it's really aborted
711 ERROR: current transaction is aborted, commands ignored until end of transaction block
712 COMMIT AND CHAIN; -- TBLOCK_ABORT_END
713 SHOW transaction_isolation;
714 transaction_isolation
715 -----------------------
719 SHOW transaction_read_only;
720 transaction_read_only
721 -----------------------
725 SHOW transaction_deferrable;
726 transaction_deferrable
727 ------------------------
731 INSERT INTO abc VALUES (4);
733 START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
734 SHOW transaction_isolation;
735 transaction_isolation
736 -----------------------
740 SHOW transaction_read_only;
741 transaction_read_only
742 -----------------------
746 SHOW transaction_deferrable;
747 transaction_deferrable
748 ------------------------
753 INSERT INTO abc VALUES ('error');
754 ERROR: invalid input syntax for type integer: "error"
755 LINE 1: INSERT INTO abc VALUES ('error');
757 COMMIT AND CHAIN; -- TBLOCK_ABORT_PENDING
758 SHOW transaction_isolation;
759 transaction_isolation
760 -----------------------
764 SHOW transaction_read_only;
765 transaction_read_only
766 -----------------------
770 SHOW transaction_deferrable;
771 transaction_deferrable
772 ------------------------
776 INSERT INTO abc VALUES (5);
778 START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
779 SHOW transaction_isolation;
780 transaction_isolation
781 -----------------------
785 SHOW transaction_read_only;
786 transaction_read_only
787 -----------------------
791 SHOW transaction_deferrable;
792 transaction_deferrable
793 ------------------------
798 COMMIT AND CHAIN; -- TBLOCK_SUBCOMMIT
799 SHOW transaction_isolation;
800 transaction_isolation
801 -----------------------
805 SHOW transaction_read_only;
806 transaction_read_only
807 -----------------------
811 SHOW transaction_deferrable;
812 transaction_deferrable
813 ------------------------
818 -- different mix of options just for fun
819 START TRANSACTION ISOLATION LEVEL SERIALIZABLE, READ WRITE, NOT DEFERRABLE;
820 SHOW transaction_isolation;
821 transaction_isolation
822 -----------------------
826 SHOW transaction_read_only;
827 transaction_read_only
828 -----------------------
832 SHOW transaction_deferrable;
833 transaction_deferrable
834 ------------------------
838 INSERT INTO abc VALUES (6);
839 ROLLBACK AND CHAIN; -- TBLOCK_ABORT_PENDING
840 SHOW transaction_isolation;
841 transaction_isolation
842 -----------------------
846 SHOW transaction_read_only;
847 transaction_read_only
848 -----------------------
852 SHOW transaction_deferrable;
853 transaction_deferrable
854 ------------------------
858 INSERT INTO abc VALUES ('error');
859 ERROR: invalid input syntax for type integer: "error"
860 LINE 1: INSERT INTO abc VALUES ('error');
862 ROLLBACK AND CHAIN; -- TBLOCK_ABORT_END
863 SHOW transaction_isolation;
864 transaction_isolation
865 -----------------------
869 SHOW transaction_read_only;
870 transaction_read_only
871 -----------------------
875 SHOW transaction_deferrable;
876 transaction_deferrable
877 ------------------------
882 -- not allowed outside a transaction block
883 COMMIT AND CHAIN; -- error
884 ERROR: COMMIT AND CHAIN can only be used in transaction blocks
885 ROLLBACK AND CHAIN; -- error
886 ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
887 SELECT * FROM abc ORDER BY 1;
896 RESET default_transaction_read_only;
898 -- Test assorted behaviors around the implicit transaction block created
899 -- when multiple SQL commands are sent in a single Query message. These
900 -- tests rely on the fact that psql will not break SQL commands apart at a
901 -- backslash-quoted semicolon, but will send them as one Query.
902 create temp table i_table (f1 int);
903 -- psql will show only the last result in a multi-statement Query
904 SELECT 1\; SELECT 2\; SELECT 3;
910 -- this implicitly commits:
911 insert into i_table values(1)\; select * from i_table;
917 -- 1/0 error will cause rolling back the whole implicit transaction
918 insert into i_table values(2)\; select * from i_table\; select 1/0;
919 ERROR: division by zero
920 select * from i_table;
926 rollback; -- we are not in a transaction at this point
927 WARNING: there is no transaction in progress
928 -- can use regular begin/commit/rollback within a single Query
929 begin\; insert into i_table values(3)\; commit;
930 rollback; -- we are not in a transaction at this point
931 WARNING: there is no transaction in progress
932 begin\; insert into i_table values(4)\; rollback;
933 rollback; -- we are not in a transaction at this point
934 WARNING: there is no transaction in progress
935 -- begin converts implicit transaction into a regular one that
936 -- can extend past the end of the Query
937 select 1\; begin\; insert into i_table values(5);
939 select 1\; begin\; insert into i_table values(6);
941 -- commit in implicit-transaction state commits but issues a warning.
942 insert into i_table values(7)\; commit\; insert into i_table values(8)\; select 1/0;
943 WARNING: there is no transaction in progress
944 ERROR: division by zero
945 -- similarly, rollback aborts but issues a warning.
946 insert into i_table values(9)\; rollback\; select 2;
947 WARNING: there is no transaction in progress
953 select * from i_table;
962 rollback; -- we are not in a transaction at this point
963 WARNING: there is no transaction in progress
964 -- implicit transaction block is still a transaction block, for e.g. VACUUM
966 ERROR: VACUUM cannot run inside a transaction block
967 SELECT 1\; COMMIT\; VACUUM;
968 WARNING: there is no transaction in progress
969 ERROR: VACUUM cannot run inside a transaction block
970 -- we disallow savepoint-related commands in implicit-transaction state
971 SELECT 1\; SAVEPOINT sp;
972 ERROR: SAVEPOINT can only be used in transaction blocks
973 SELECT 1\; COMMIT\; SAVEPOINT sp;
974 WARNING: there is no transaction in progress
975 ERROR: SAVEPOINT can only be used in transaction blocks
976 ROLLBACK TO SAVEPOINT sp\; SELECT 2;
977 ERROR: ROLLBACK TO SAVEPOINT can only be used in transaction blocks
978 SELECT 2\; RELEASE SAVEPOINT sp\; SELECT 3;
979 ERROR: RELEASE SAVEPOINT can only be used in transaction blocks
980 -- but this is OK, because the BEGIN converts it to a regular xact
981 SELECT 1\; BEGIN\; SAVEPOINT sp\; ROLLBACK TO SAVEPOINT sp\; COMMIT;
982 -- Tests for AND CHAIN in implicit transaction blocks
983 SET TRANSACTION READ ONLY\; COMMIT AND CHAIN; -- error
984 ERROR: COMMIT AND CHAIN can only be used in transaction blocks
985 SHOW transaction_read_only;
986 transaction_read_only
987 -----------------------
991 SET TRANSACTION READ ONLY\; ROLLBACK AND CHAIN; -- error
992 ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
993 SHOW transaction_read_only;
994 transaction_read_only
995 -----------------------
999 CREATE TABLE abc (a int);
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
1002 WARNING: there is no transaction in progress
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
1005 WARNING: there is no transaction in progress
1006 ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
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
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
1011 ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
1012 -- START TRANSACTION + COMMIT/ROLLBACK AND CHAIN
1013 START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (15)\; COMMIT AND CHAIN; -- 15 ok
1014 SHOW transaction_isolation; -- transaction is active at this point
1015 transaction_isolation
1016 -----------------------
1021 START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (16)\; ROLLBACK AND CHAIN; -- 16 ok
1022 SHOW transaction_isolation; -- transaction is active at this point
1023 transaction_isolation
1024 -----------------------
1029 SET default_transaction_isolation = 'read committed';
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
1032 ERROR: COMMIT AND CHAIN can only be used in transaction blocks
1033 SHOW transaction_isolation; -- out of transaction block
1034 transaction_isolation
1035 -----------------------
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
1040 ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
1041 SHOW transaction_isolation; -- out of transaction block
1042 transaction_isolation
1043 -----------------------
1047 RESET default_transaction_isolation;
1048 SELECT * FROM abc ORDER BY 1;
1057 -- Test for successful cleanup of an aborted transaction at session exit.
1058 -- THIS MUST BE THE LAST TEST IN THIS FILE.
1061 ERROR: division by zero
1063 ERROR: savepoint "x" does not exist
1064 -- DO NOT ADD ANYTHING HERE.