@@ -68,9 +68,19 @@ diff ../../../src/test/regress/expected/create_index.out ../tmp_check/regress_ou
68
68
- ERROR: CREATE INDEX CONCURRENTLY cannot run inside a transaction block
69
69
+ ERROR: multimaster doesn't support CREATE INDEX CONCURRENTLY
70
70
COMMIT;
71
+ -- test where predicate is able to do a transactional update during
72
+ -- a concurrent build before switching pg_index state flags.
73
+ @@ -1403,7 +1405,9 @@
74
+ END; $$;
75
+ CREATE INDEX CONCURRENTLY concur_index8 ON concur_heap (f1)
76
+ WHERE predicate_stable();
77
+ + ERROR: multimaster doesn't support CREATE INDEX CONCURRENTLY
78
+ DROP INDEX concur_index8;
79
+ + ERROR: index "concur_index8" does not exist
80
+ DROP FUNCTION predicate_stable();
71
81
-- But you can do a regular index build in a transaction
72
82
BEGIN;
73
- @@ -1400 ,8 +1402 ,6 @@
83
+ @@ -1412 ,8 +1416 ,6 @@
74
84
-- Failed builds are left invalid by VACUUM FULL, fixed by REINDEX
75
85
VACUUM FULL concur_heap;
76
86
REINDEX TABLE concur_heap;
@@ -79,7 +89,7 @@ diff ../../../src/test/regress/expected/create_index.out ../tmp_check/regress_ou
79
89
DELETE FROM concur_heap WHERE f1 = 'b';
80
90
VACUUM FULL concur_heap;
81
91
\d concur_heap
82
- @@ -1411 ,12 +1411 ,6 @@
92
+ @@ -1423 ,12 +1425 ,6 @@
83
93
f1 | text | | |
84
94
f2 | text | | |
85
95
Indexes:
@@ -92,7 +102,7 @@ diff ../../../src/test/regress/expected/create_index.out ../tmp_check/regress_ou
92
102
"std_index" btree (f2)
93
103
94
104
REINDEX TABLE concur_heap;
95
- @@ -1427 ,12 +1421 ,6 @@
105
+ @@ -1439 ,12 +1435 ,6 @@
96
106
f1 | text | | |
97
107
f2 | text | | |
98
108
Indexes:
@@ -105,7 +115,7 @@ diff ../../../src/test/regress/expected/create_index.out ../tmp_check/regress_ou
105
115
"std_index" btree (f2)
106
116
107
117
-- Temporary tables with concurrent builds and on-commit actions
108
- @@ -1442 ,7 +1430 ,9 @@
118
+ @@ -1454 ,7 +1444 ,9 @@
109
119
ON COMMIT PRESERVE ROWS;
110
120
INSERT INTO concur_temp VALUES (1, 'foo'), (2, 'bar');
111
121
CREATE INDEX CONCURRENTLY concur_temp_ind ON concur_temp(f1);
@@ -115,7 +125,7 @@ diff ../../../src/test/regress/expected/create_index.out ../tmp_check/regress_ou
115
125
DROP TABLE concur_temp;
116
126
-- ON COMMIT DROP
117
127
BEGIN;
118
- @@ -1451 ,34 +1441 ,42 @@
128
+ @@ -1463 ,34 +1455 ,42 @@
119
129
INSERT INTO concur_temp VALUES (1, 'foo'), (2, 'bar');
120
130
-- Fails when running in a transaction.
121
131
CREATE INDEX CONCURRENTLY concur_temp_ind ON concur_temp(f1);
@@ -162,7 +172,7 @@ diff ../../../src/test/regress/expected/create_index.out ../tmp_check/regress_ou
162
172
\d concur_heap
163
173
Table "public.concur_heap"
164
174
Column | Type | Collation | Nullable | Default
165
- @@ -2416 ,46 +2414 ,38 @@
175
+ @@ -2428 ,46 +2428 ,38 @@
166
176
INSERT INTO concur_reindex_tab4 VALUES (1), (1), (2);
167
177
-- This trick creates an invalid index.
168
178
CREATE UNIQUE INDEX CONCURRENTLY concur_reindex_ind5 ON concur_reindex_tab4 (c1);
@@ -374,7 +384,36 @@ diff ../../../src/test/regress/expected/transactions.out ../tmp_check/regress_ou
374
384
COMMIT;
375
385
START TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE, DEFERRABLE;
376
386
SHOW transaction_isolation;
377
- @@ -841,17 +829,14 @@
387
+ @@ -796,24 +784,13 @@
388
+
389
+ SAVEPOINT x;
390
+ COMMIT AND CHAIN; -- TBLOCK_SUBCOMMIT
391
+ + ERROR: [MTM] COMMIT AND CHAIN is not supported
392
+ SHOW transaction_isolation;
393
+ - transaction_isolation
394
+ - -----------------------
395
+ - repeatable read
396
+ - (1 row)
397
+ -
398
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
399
+ SHOW transaction_read_only;
400
+ - transaction_read_only
401
+ - -----------------------
402
+ - off
403
+ - (1 row)
404
+ -
405
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
406
+ SHOW transaction_deferrable;
407
+ - transaction_deferrable
408
+ - ------------------------
409
+ - on
410
+ - (1 row)
411
+ -
412
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
413
+ COMMIT;
414
+ -- different mix of options just for fun
415
+ START TRANSACTION ISOLATION LEVEL SERIALIZABLE, READ WRITE, NOT DEFERRABLE;
416
+ @@ -881,17 +858,14 @@
378
417
ROLLBACK;
379
418
-- not allowed outside a transaction block
380
419
COMMIT AND CHAIN; -- error
@@ -394,7 +433,7 @@ diff ../../../src/test/regress/expected/transactions.out ../tmp_check/regress_ou
394
433
395
434
RESET default_transaction_read_only;
396
435
DROP TABLE abc;
397
- @@ -941 ,7 +926 ,7 @@
436
+ @@ -981 ,7 +955 ,7 @@
398
437
SELECT 1\; BEGIN\; SAVEPOINT sp\; ROLLBACK TO SAVEPOINT sp\; COMMIT;
399
438
-- Tests for AND CHAIN in implicit transaction blocks
400
439
SET TRANSACTION READ ONLY\; COMMIT AND CHAIN; -- error
@@ -403,7 +442,7 @@ diff ../../../src/test/regress/expected/transactions.out ../tmp_check/regress_ou
403
442
SHOW transaction_read_only;
404
443
transaction_read_only
405
444
-----------------------
406
- @@ -960 ,23 +945 ,20 @@
445
+ @@ -1000 ,23 +974 ,20 @@
407
446
-- COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
408
447
INSERT INTO abc VALUES (7)\; COMMIT\; INSERT INTO abc VALUES (8)\; COMMIT AND CHAIN; -- 7 commit, 8 error
409
448
WARNING: there is no transaction in progress
@@ -431,7 +470,7 @@ diff ../../../src/test/regress/expected/transactions.out ../tmp_check/regress_ou
431
470
COMMIT;
432
471
START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (16)\; ROLLBACK AND CHAIN; -- 16 ok
433
472
SHOW transaction_isolation; -- transaction is active at this point
434
- @@ -988 ,7 +970 ,7 @@
473
+ @@ -1028 ,7 +999 ,7 @@
435
474
ROLLBACK;
436
475
-- START TRANSACTION + COMMIT/ROLLBACK + COMMIT/ROLLBACK AND CHAIN
437
476
START TRANSACTION ISOLATION LEVEL REPEATABLE READ\; INSERT INTO abc VALUES (17)\; COMMIT\; INSERT INTO abc VALUES (18)\; COMMIT AND CHAIN; -- 17 commit, 18 error
@@ -440,7 +479,7 @@ diff ../../../src/test/regress/expected/transactions.out ../tmp_check/regress_ou
440
479
SHOW transaction_isolation; -- out of transaction block
441
480
transaction_isolation
442
481
-----------------------
443
- @@ -1007 ,9 +989 ,8 @@
482
+ @@ -1047 ,9 +1018 ,8 @@
444
483
a
445
484
----
446
485
7
@@ -554,6 +593,118 @@ diff ../../../src/test/regress/expected/atx5.out ../tmp_check/regress_outdir/res
554
593
SET client_min_messages = 'warning';
555
594
DROP FUNCTION IF EXISTS atx_test_30_one();
556
595
DROP FUNCTION IF EXISTS atx_test_30_two();
596
+ diff ../../../src/test/regress/expected/atx9.out ../tmp_check/regress_outdir/results/atx9.out
597
+ --- ../../../src/test/regress/expected/atx9.out CENSORED
598
+ +++ ../tmp_check/regress_outdir/results/atx9.out CENSORED
599
+ @@ -29,50 +29,38 @@
600
+ INSERT INTO abc VALUES (1);
601
+ INSERT INTO abc VALUES (2);
602
+ COMMIT AND CHAIN; -- TBLOCK_END
603
+ + ERROR: [MTM] COMMIT AND CHAIN is not supported
604
+ SHOW transaction_isolation;
605
+ - transaction_isolation
606
+ - -----------------------
607
+ - repeatable read
608
+ - (1 row)
609
+ -
610
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
611
+ SHOW transaction_read_only;
612
+ - transaction_read_only
613
+ - -----------------------
614
+ - off
615
+ - (1 row)
616
+ -
617
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
618
+ SHOW transaction_deferrable;
619
+ - transaction_deferrable
620
+ - ------------------------
621
+ - on
622
+ - (1 row)
623
+ -
624
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
625
+ INSERT INTO abc VALUES ('error');
626
+ - ERROR: invalid input syntax for type integer: "error"
627
+ - LINE 1: INSERT INTO abc VALUES ('error');
628
+ - ^
629
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
630
+ INSERT INTO abc VALUES (3); -- check it's really aborted
631
+ ERROR: current transaction is aborted, commands ignored until end of transaction block
632
+ COMMIT AND CHAIN; -- TBLOCK_ABORT_END
633
+ SHOW transaction_isolation;
634
+ transaction_isolation
635
+ -----------------------
636
+ - repeatable read
637
+ + read committed
638
+ (1 row)
639
+
640
+ SHOW transaction_read_only;
641
+ transaction_read_only
642
+ -----------------------
643
+ - off
644
+ + on
645
+ (1 row)
646
+
647
+ SHOW transaction_deferrable;
648
+ transaction_deferrable
649
+ ------------------------
650
+ - on
651
+ + off
652
+ (1 row)
653
+
654
+ INSERT INTO abc VALUES (4);
655
+ + ERROR: cannot execute INSERT in a read-only transaction
656
+ COMMIT;
657
+ ROLLBACK;
658
+ BEGIN;
659
+ @@ -144,24 +132,13 @@
660
+
661
+ SAVEPOINT x;
662
+ COMMIT AND CHAIN; -- TBLOCK_SUBCOMMIT
663
+ + ERROR: [MTM] COMMIT AND CHAIN is not supported
664
+ SHOW transaction_isolation;
665
+ - transaction_isolation
666
+ - -----------------------
667
+ - repeatable read
668
+ - (1 row)
669
+ -
670
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
671
+ SHOW transaction_read_only;
672
+ - transaction_read_only
673
+ - -----------------------
674
+ - off
675
+ - (1 row)
676
+ -
677
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
678
+ SHOW transaction_deferrable;
679
+ - transaction_deferrable
680
+ - ------------------------
681
+ - on
682
+ - (1 row)
683
+ -
684
+ + ERROR: current transaction is aborted, commands ignored until end of transaction block
685
+ COMMIT;
686
+ ROLLBACK;
687
+ -- different mix of options just for fun
688
+ @@ -232,17 +209,14 @@
689
+ COMMIT;
690
+ -- not allowed outside a transaction block
691
+ COMMIT AUTONOMOUS AND CHAIN; -- error
692
+ - ERROR: COMMIT AND CHAIN can only be used in transaction blocks
693
+ + ERROR: [MTM] COMMIT AND CHAIN is not supported
694
+ ROLLBACK AUTONOMOUS AND CHAIN; -- error
695
+ ERROR: ROLLBACK AND CHAIN can only be used in transaction blocks
696
+ SELECT * FROM abc ORDER BY 1;
697
+ a
698
+ ---
699
+ - 1
700
+ - 2
701
+ - 4
702
+ 5
703
+ - (4 rows)
704
+ + (1 row)
705
+
706
+ RESET default_transaction_read_only;
707
+ DROP TABLE abc;
557
708
diff ../../../src/test/regress/expected/rules.out ../tmp_check/regress_outdir/results/rules.out
558
709
--- ../../../src/test/regress/expected/rules.out CENSORED
559
710
+++ ../tmp_check/regress_outdir/results/rules.out CENSORED
@@ -632,7 +783,7 @@ diff ../../../src/test/regress/expected/rules.out ../tmp_check/regress_outdir/re
632
783
UNION ALL
633
784
SELECT l.objoid,
634
785
l.classoid,
635
- @@ -2065 ,7 +2085 ,7 @@
786
+ @@ -2066 ,7 +2086 ,7 @@
636
787
st.last_msg_receipt_time,
637
788
st.latest_end_lsn,
638
789
st.latest_end_time
@@ -641,7 +792,7 @@ diff ../../../src/test/regress/expected/rules.out ../tmp_check/regress_outdir/re
641
792
LEFT JOIN pg_stat_get_subscription(NULL::oid) st(subid, relid, pid, received_lsn, last_msg_send_time, last_msg_receipt_time, latest_end_lsn, latest_end_time) ON ((st.subid = su.oid)));
642
793
pg_stat_sys_indexes| SELECT pg_stat_all_indexes.relid,
643
794
pg_stat_all_indexes.indexrelid,
644
- @@ -2407 ,6 +2427 ,17 @@
795
+ @@ -2408 ,6 +2428 ,17 @@
645
796
FROM (unnest(s.stxkeys) k(k)
646
797
JOIN pg_attribute a ON (((a.attrelid = s.stxrelid) AND (a.attnum = k.k))))
647
798
WHERE (NOT has_column_privilege(c.oid, a.attnum, 'select'::text))))) AND ((c.relrowsecurity = false) OR (NOT row_security_active(c.oid))));
0 commit comments