Commit 4a054069 authored by Tom Lane's avatar Tom Lane

Improve display of query results in isolation tests.

Previously, isolationtester displayed SQL query results using some
ad-hoc code that clearly hadn't had much effort expended on it.
Field values longer than 14 characters weren't separated from
the next field, and usually caused misalignment of the columns
too.  Also there was no visual separation of a query's result
from subsequent isolationtester output.  This made test result
files confusing and hard to read.

To improve matters, let's use libpq's PQprint() function.  Although
that's long since unused by psql, it's still plenty good enough
for the purpose here.

Like 741d7f10, back-patch to all supported branches, so that this
isn't a stumbling block for back-patching isolation test changes.

Discussion: https://postgr.es/m/582362.1623798221@sss.pgh.pa.us
parent 24043c27
...@@ -9,12 +9,16 @@ step s1_toast_insert: INSERT INTO stream_test SELECT large_val(); ...@@ -9,12 +9,16 @@ step s1_toast_insert: INSERT INTO stream_test SELECT large_val();
step s2_ddl: CREATE TABLE stream_test2(data text); step s2_ddl: CREATE TABLE stream_test2(data text);
step s1_commit: COMMIT; step s1_commit: COMMIT;
step s1_get_stream_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL,NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1'); step s1_get_stream_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL,NULL, 'include-xids', '0', 'skip-empty-xacts', '1', 'stream-changes', '1');
data data
----------------------------------------
opening a streamed block for transaction opening a streamed block for transaction
streaming change for transaction streaming change for transaction
closing a streamed block for transaction closing a streamed block for transaction
committing streamed transaction committing streamed transaction
?column? (4 rows)
?column?
--------
stop
(1 row)
stop
...@@ -6,33 +6,45 @@ step s1w: INSERT INTO do_write DEFAULT VALUES; ...@@ -6,33 +6,45 @@ step s1w: INSERT INTO do_write DEFAULT VALUES;
step s2init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); <waiting ...> step s2init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
step s2init: <... completed> step s2init: <... completed>
?column? ?column?
--------
init
(1 row)
init
step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
----
(0 rows)
step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE; step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s1w: INSERT INTO do_write DEFAULT VALUES; step s1w: INSERT INTO do_write DEFAULT VALUES;
step s1c: COMMIT; step s1c: COMMIT;
step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:2 table public.do_write: INSERT: id[integer]:2
COMMIT COMMIT
(3 rows)
step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE; step s1b: BEGIN ISOLATION LEVEL SERIALIZABLE;
step s1w: INSERT INTO do_write DEFAULT VALUES; step s1w: INSERT INTO do_write DEFAULT VALUES;
step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
----
(0 rows)
step s1c: COMMIT; step s1c: COMMIT;
step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s2start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:3 table public.do_write: INSERT: id[integer]:3
COMMIT COMMIT
?column? (3 rows)
?column?
--------
stop
(1 row)
stop
...@@ -2,65 +2,89 @@ Parsed test spec with 3 sessions ...@@ -2,65 +2,89 @@ Parsed test spec with 3 sessions
starting permutation: s0init s0start s1begin s1sharepgclass s2begin s2sharepgclass s0w s0start s2commit s1commit starting permutation: s0init s0start s1begin s1sharepgclass s2begin s2sharepgclass s0w s0start s2commit s1commit
step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding');
?column? ?column?
--------
init
(1 row)
init
step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
----
(0 rows)
step s1begin: BEGIN; step s1begin: BEGIN;
step s1sharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR SHARE) s; step s1sharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR SHARE) s;
?column? ?column?
--------
t
(1 row)
t
step s2begin: BEGIN; step s2begin: BEGIN;
step s2sharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR SHARE) s; step s2sharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR SHARE) s;
?column? ?column?
--------
t
(1 row)
t
step s0w: INSERT INTO do_write DEFAULT VALUES; step s0w: INSERT INTO do_write DEFAULT VALUES;
step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:1 table public.do_write: INSERT: id[integer]:1
COMMIT COMMIT
(3 rows)
step s2commit: COMMIT; step s2commit: COMMIT;
step s1commit: COMMIT; step s1commit: COMMIT;
?column? ?column?
--------
stop
(1 row)
stop
starting permutation: s0init s0start s1begin s1keysharepgclass s2begin s2keysharepgclass s0alter s0w s0start s2commit s1commit starting permutation: s0init s0start s1begin s1keysharepgclass s2begin s2keysharepgclass s0alter s0w s0start s2commit s1commit
step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); step s0init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding');
?column? ?column?
--------
init
(1 row)
init
step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
----
(0 rows)
step s1begin: BEGIN; step s1begin: BEGIN;
step s1keysharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR KEY SHARE) s; step s1keysharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR KEY SHARE) s;
?column? ?column?
--------
t
(1 row)
t
step s2begin: BEGIN; step s2begin: BEGIN;
step s2keysharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR KEY SHARE) s; step s2keysharepgclass: SELECT count(*) > 1 FROM (SELECT * FROM pg_class FOR KEY SHARE) s;
?column? ?column?
--------
t
(1 row)
t
step s0alter: ALTER TABLE do_write ADD column ts timestamptz; step s0alter: ALTER TABLE do_write ADD column ts timestamptz;
step s0w: INSERT INTO do_write DEFAULT VALUES; step s0w: INSERT INTO do_write DEFAULT VALUES;
step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s0start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
------------------------------------------------------------------------------
BEGIN BEGIN
COMMIT COMMIT
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:1 ts[timestamp with time zone]:null table public.do_write: INSERT: id[integer]:1 ts[timestamp with time zone]:null
COMMIT COMMIT
(5 rows)
step s2commit: COMMIT; step s2commit: COMMIT;
step s1commit: COMMIT; step s1commit: COMMIT;
?column? ?column?
--------
stop
(1 row)
stop
...@@ -3,28 +3,38 @@ Parsed test spec with 2 sessions ...@@ -3,28 +3,38 @@ Parsed test spec with 2 sessions
starting permutation: s0_begin s0_getxid s1_begin s1_insert s0_alter s0_commit s0_checkpoint s0_get_changes s0_get_changes s1_commit s0_vacuum s0_get_changes starting permutation: s0_begin s0_getxid s1_begin s1_insert s0_alter s0_commit s0_checkpoint s0_get_changes s0_get_changes s1_commit s0_vacuum s0_get_changes
step s0_begin: BEGIN; step s0_begin: BEGIN;
step s0_getxid: SELECT pg_current_xact_id() IS NULL; step s0_getxid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f
(1 row)
f
step s1_begin: BEGIN; step s1_begin: BEGIN;
step s1_insert: INSERT INTO harvest VALUES ((1, 2, 3)); step s1_insert: INSERT INTO harvest VALUES ((1, 2, 3));
step s0_alter: ALTER TYPE basket DROP ATTRIBUTE mangos; step s0_alter: ALTER TYPE basket DROP ATTRIBUTE mangos;
step s0_commit: COMMIT; step s0_commit: COMMIT;
step s0_checkpoint: CHECKPOINT; step s0_checkpoint: CHECKPOINT;
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
----
(0 rows)
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
----
(0 rows)
step s1_commit: COMMIT; step s1_commit: COMMIT;
step s0_vacuum: VACUUM pg_attribute; step s0_vacuum: VACUUM pg_attribute;
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
------------------------------------------------------
BEGIN BEGIN
table public.harvest: INSERT: fruits[basket]:'(1,2,3)' table public.harvest: INSERT: fruits[basket]:'(1,2,3)'
COMMIT COMMIT
?column? (3 rows)
?column?
--------
stop
(1 row)
stop
...@@ -3,50 +3,64 @@ Parsed test spec with 3 sessions ...@@ -3,50 +3,64 @@ Parsed test spec with 3 sessions
starting permutation: s2b s2txid s1init s3b s3txid s2alter s2c s2b s2txid s3c s2c s1insert s1checkpoint s1start s1insert s1alter s1insert s1start starting permutation: s2b s2txid s1init s3b s3txid s2alter s2c s2b s2txid s3c s2c s1insert s1checkpoint s1start s1insert s1alter s1insert s1start
step s2b: BEGIN; step s2b: BEGIN;
step s2txid: SELECT pg_current_xact_id() IS NULL; step s2txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f
(1 row)
f
step s1init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); <waiting ...> step s1init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding'); <waiting ...>
step s3b: BEGIN; step s3b: BEGIN;
step s3txid: SELECT pg_current_xact_id() IS NULL; step s3txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f
(1 row)
f
step s2alter: ALTER TABLE do_write ADD COLUMN addedbys2 int; step s2alter: ALTER TABLE do_write ADD COLUMN addedbys2 int;
step s2c: COMMIT; step s2c: COMMIT;
step s2b: BEGIN; step s2b: BEGIN;
step s2txid: SELECT pg_current_xact_id() IS NULL; step s2txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f
(1 row)
f
step s3c: COMMIT; step s3c: COMMIT;
step s1init: <... completed> step s1init: <... completed>
?column? ?column?
--------
init
(1 row)
init
step s2c: COMMIT; step s2c: COMMIT;
step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1insert: INSERT INTO do_write DEFAULT VALUES;
step s1checkpoint: CHECKPOINT; step s1checkpoint: CHECKPOINT;
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:1 addedbys2[integer]:null table public.do_write: INSERT: id[integer]:1 addedbys2[integer]:null
COMMIT COMMIT
(3 rows)
step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1insert: INSERT INTO do_write DEFAULT VALUES;
step s1alter: ALTER TABLE do_write ADD COLUMN addedbys1 int; step s1alter: ALTER TABLE do_write ADD COLUMN addedbys1 int;
step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1insert: INSERT INTO do_write DEFAULT VALUES;
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false'); step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false');
data data
--------------------------------------------------------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:2 addedbys2[integer]:null table public.do_write: INSERT: id[integer]:2 addedbys2[integer]:null
COMMIT COMMIT
BEGIN BEGIN
COMMIT COMMIT
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:3 addedbys2[integer]:null addedbys1[integer]:null table public.do_write: INSERT: id[integer]:3 addedbys2[integer]:null addedbys1[integer]:null
COMMIT COMMIT
?column? (8 rows)
?column?
--------
stop
(1 row)
stop
...@@ -4,32 +4,40 @@ starting permutation: s0_begin s0_begin_sub0 s0_log_assignment s0_sub_get_base_s ...@@ -4,32 +4,40 @@ starting permutation: s0_begin s0_begin_sub0 s0_log_assignment s0_sub_get_base_s
step s0_begin: BEGIN; step s0_begin: BEGIN;
step s0_begin_sub0: SAVEPOINT s0; step s0_begin_sub0: SAVEPOINT s0;
step s0_log_assignment: SELECT pg_current_xact_id() IS NULL; step s0_log_assignment: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f
(1 row)
f
step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0); step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0);
step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int; step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int;
step s0_insert: INSERT INTO harvest VALUES (1, 2, 3); step s0_insert: INSERT INTO harvest VALUES (1, 2, 3);
step s0_end_sub0: RELEASE SAVEPOINT s0; step s0_end_sub0: RELEASE SAVEPOINT s0;
step s0_commit: COMMIT; step s0_commit: COMMIT;
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
----------------------------------------------------------------------------------
BEGIN BEGIN
table public.dummy: INSERT: i[integer]:0 table public.dummy: INSERT: i[integer]:0
table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3 table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3
COMMIT COMMIT
?column? (4 rows)
?column?
--------
stop
(1 row)
stop
starting permutation: s0_begin s0_begin_sub0 s0_log_assignment s0_begin_sub1 s0_sub_get_base_snap s1_produce_new_snap s0_insert s0_end_sub1 s0_end_sub0 s0_commit s0_get_changes starting permutation: s0_begin s0_begin_sub0 s0_log_assignment s0_begin_sub1 s0_sub_get_base_snap s1_produce_new_snap s0_insert s0_end_sub1 s0_end_sub0 s0_commit s0_get_changes
step s0_begin: BEGIN; step s0_begin: BEGIN;
step s0_begin_sub0: SAVEPOINT s0; step s0_begin_sub0: SAVEPOINT s0;
step s0_log_assignment: SELECT pg_current_xact_id() IS NULL; step s0_log_assignment: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f
(1 row)
f
step s0_begin_sub1: SAVEPOINT s1; step s0_begin_sub1: SAVEPOINT s1;
step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0); step s0_sub_get_base_snap: INSERT INTO dummy VALUES (0);
step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int; step s1_produce_new_snap: ALTER TABLE harvest ADD COLUMN mangos int;
...@@ -38,12 +46,16 @@ step s0_end_sub1: RELEASE SAVEPOINT s1; ...@@ -38,12 +46,16 @@ step s0_end_sub1: RELEASE SAVEPOINT s1;
step s0_end_sub0: RELEASE SAVEPOINT s0; step s0_end_sub0: RELEASE SAVEPOINT s0;
step s0_commit: COMMIT; step s0_commit: COMMIT;
step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s0_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
----------------------------------------------------------------------------------
BEGIN BEGIN
table public.dummy: INSERT: i[integer]:0 table public.dummy: INSERT: i[integer]:0
table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3 table public.harvest: INSERT: apples[integer]:1 pears[integer]:2 mangos[integer]:3
COMMIT COMMIT
?column? (4 rows)
?column?
--------
stop
(1 row)
stop
...@@ -15,25 +15,35 @@ step s2_checkpoint: CHECKPOINT; ...@@ -15,25 +15,35 @@ step s2_checkpoint: CHECKPOINT;
step s1_begin: BEGIN; step s1_begin: BEGIN;
step s1_dml: INSERT INTO harvest VALUES (43); step s1_dml: INSERT INTO harvest VALUES (43);
step s0_many_subxacts: select subxacts(); step s0_many_subxacts: select subxacts();
subxacts subxacts
--------
(1 row)
step s0_commit: COMMIT; step s0_commit: COMMIT;
step s2_checkpoint: CHECKPOINT; step s2_checkpoint: CHECKPOINT;
step s2_get_changes_suppress_output: SELECT null n FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1') GROUP BY n; step s2_get_changes_suppress_output: SELECT null n FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1') GROUP BY n;
n n
-
(1 row)
step s2_get_changes_suppress_output: SELECT null n FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1') GROUP BY n; step s2_get_changes_suppress_output: SELECT null n FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1') GROUP BY n;
n n
-
(0 rows)
step s1_commit: COMMIT; step s1_commit: COMMIT;
step s2_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1'); step s2_get_changes: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');
data data
------------------------------------------------
BEGIN BEGIN
table public.harvest: INSERT: apples[integer]:43 table public.harvest: INSERT: apples[integer]:43
COMMIT COMMIT
?column? (3 rows)
?column?
--------
stop
(1 row)
stop
...@@ -3,39 +3,51 @@ Parsed test spec with 3 sessions ...@@ -3,39 +3,51 @@ Parsed test spec with 3 sessions
starting permutation: s2b s2txid s1init s3b s3txid s2c s2b s2insert s2p s3c s1insert s1start s2cp s1start starting permutation: s2b s2txid s1init s3b s3txid s2c s2b s2insert s2p s3c s1insert s1start s2cp s1start
step s2b: BEGIN; step s2b: BEGIN;
step s2txid: SELECT pg_current_xact_id() IS NULL; step s2txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f
(1 row)
f
step s1init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding', false, true); <waiting ...> step s1init: SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding', false, true); <waiting ...>
step s3b: BEGIN; step s3b: BEGIN;
step s3txid: SELECT pg_current_xact_id() IS NULL; step s3txid: SELECT pg_current_xact_id() IS NULL;
?column? ?column?
--------
f
(1 row)
f
step s2c: COMMIT; step s2c: COMMIT;
step s2b: BEGIN; step s2b: BEGIN;
step s2insert: INSERT INTO do_write DEFAULT VALUES; step s2insert: INSERT INTO do_write DEFAULT VALUES;
step s2p: PREPARE TRANSACTION 'test1'; step s2p: PREPARE TRANSACTION 'test1';
step s3c: COMMIT; step s3c: COMMIT;
step s1init: <... completed> step s1init: <... completed>
?column? ?column?
--------
init
(1 row)
init
step s1insert: INSERT INTO do_write DEFAULT VALUES; step s1insert: INSERT INTO do_write DEFAULT VALUES;
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:2 table public.do_write: INSERT: id[integer]:2
COMMIT COMMIT
(3 rows)
step s2cp: COMMIT PREPARED 'test1'; step s2cp: COMMIT PREPARED 'test1';
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1'); step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1');
data data
--------------------------------------------
BEGIN BEGIN
table public.do_write: INSERT: id[integer]:1 table public.do_write: INSERT: id[integer]:1
PREPARE TRANSACTION 'test1' PREPARE TRANSACTION 'test1'
COMMIT PREPARED 'test1' COMMIT PREPARED 'test1'
?column? (4 rows)
?column?
--------
stop
(1 row)
stop
...@@ -5,14 +5,18 @@ step s1s: SAVEPOINT f; ...@@ -5,14 +5,18 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s1s s1u s1r s1l s2l s1c s2c starting permutation: s1s s1u s1r s1l s2l s1c s2c
...@@ -20,13 +24,17 @@ step s1s: SAVEPOINT f; ...@@ -20,13 +24,17 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
...@@ -35,13 +43,17 @@ step s1s: SAVEPOINT f; ...@@ -35,13 +43,17 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
...@@ -50,13 +62,17 @@ step s1s: SAVEPOINT f; ...@@ -50,13 +62,17 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
...@@ -65,13 +81,17 @@ step s1s: SAVEPOINT f; ...@@ -65,13 +81,17 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
...@@ -80,14 +100,18 @@ step s1s: SAVEPOINT f; ...@@ -80,14 +100,18 @@ step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s1s s1u s2l s1r s1l s1c s2c starting permutation: s1s s1u s2l s1r s1l s1c s2c
...@@ -96,13 +120,17 @@ step s1u: UPDATE foo SET key = 2; ...@@ -96,13 +120,17 @@ step s1u: UPDATE foo SET key = 2;
step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...> step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
...@@ -112,13 +140,17 @@ step s1u: UPDATE foo SET key = 2; ...@@ -112,13 +140,17 @@ step s1u: UPDATE foo SET key = 2;
step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...> step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
...@@ -128,89 +160,113 @@ step s1u: UPDATE foo SET key = 2; ...@@ -128,89 +160,113 @@ step s1u: UPDATE foo SET key = 2;
step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...> step s2l: SELECT * FROM foo FOR KEY SHARE; <waiting ...>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s1s s2l s1u s2c s1r s1l s1c starting permutation: s1s s2l s1u s2c s1r s1l s1c
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1u: UPDATE foo SET key = 2; <waiting ...> step s1u: UPDATE foo SET key = 2; <waiting ...>
step s2c: COMMIT; step s2c: COMMIT;
step s1u: <... completed> step s1u: <... completed>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s1s s2l s2c s1u s1r s1l s1c starting permutation: s1s s2l s2c s1u s1r s1l s1c
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s2l s1s s1u s2c s1r s1l s1c starting permutation: s2l s1s s1u s2c s1r s1l s1c
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; <waiting ...> step s1u: UPDATE foo SET key = 2; <waiting ...>
step s2c: COMMIT; step s2c: COMMIT;
step s1u: <... completed> step s1u: <... completed>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s2l s1s s2c s1u s1r s1l s1c starting permutation: s2l s1s s2c s1u s1r s1l s1c
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s2c: COMMIT; step s2c: COMMIT;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
starting permutation: s2l s2c s1s s1u s1r s1l s1c starting permutation: s2l s2c s1s s1u s1r s1l s1c
step s2l: SELECT * FROM foo FOR KEY SHARE; step s2l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1s: SAVEPOINT f; step s1s: SAVEPOINT f;
step s1u: UPDATE foo SET key = 2; step s1u: UPDATE foo SET key = 2;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
...@@ -6,13 +6,17 @@ step s1delc1: ALTER TABLE c1 NO INHERIT p; ...@@ -6,13 +6,17 @@ step s1delc1: ALTER TABLE c1 NO INHERIT p;
step s2sel: SELECT SUM(a) FROM p; <waiting ...> step s2sel: SELECT SUM(a) FROM p; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
step s2sel: <... completed> step s2sel: <... completed>
sum sum
---
11
(1 row)
11
step s2sel: SELECT SUM(a) FROM p; step s2sel: SELECT SUM(a) FROM p;
sum sum
---
1
(1 row)
1
starting permutation: s1b s1delc1 s1addc2 s2sel s1c s2sel starting permutation: s1b s1delc1 s1addc2 s2sel s1c s2sel
step s1b: BEGIN; step s1b: BEGIN;
...@@ -21,13 +25,17 @@ step s1addc2: ALTER TABLE c2 INHERIT p; ...@@ -21,13 +25,17 @@ step s1addc2: ALTER TABLE c2 INHERIT p;
step s2sel: SELECT SUM(a) FROM p; <waiting ...> step s2sel: SELECT SUM(a) FROM p; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
step s2sel: <... completed> step s2sel: <... completed>
sum sum
---
11
(1 row)
11
step s2sel: SELECT SUM(a) FROM p; step s2sel: SELECT SUM(a) FROM p;
sum sum
---
101
(1 row)
101
starting permutation: s1b s1dropc1 s2sel s1c s2sel starting permutation: s1b s1dropc1 s2sel s1c s2sel
step s1b: BEGIN; step s1b: BEGIN;
...@@ -35,13 +43,17 @@ step s1dropc1: DROP TABLE c1; ...@@ -35,13 +43,17 @@ step s1dropc1: DROP TABLE c1;
step s2sel: SELECT SUM(a) FROM p; <waiting ...> step s2sel: SELECT SUM(a) FROM p; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
step s2sel: <... completed> step s2sel: <... completed>
sum sum
---
1
(1 row)
1
step s2sel: SELECT SUM(a) FROM p; step s2sel: SELECT SUM(a) FROM p;
sum sum
---
1
(1 row)
1
starting permutation: s1b s1delc1 s1modc1a s2sel s1c s2sel starting permutation: s1b s1delc1 s1modc1a s2sel s1c s2sel
step s1b: BEGIN; step s1b: BEGIN;
...@@ -52,6 +64,8 @@ step s1c: COMMIT; ...@@ -52,6 +64,8 @@ step s1c: COMMIT;
step s2sel: <... completed> step s2sel: <... completed>
ERROR: attribute "a" of relation "c1" does not match parent's type ERROR: attribute "a" of relation "c1" does not match parent's type
step s2sel: SELECT SUM(a) FROM p; step s2sel: SELECT SUM(a) FROM p;
sum sum
---
1
(1 row)
1
...@@ -8,9 +8,11 @@ step notify2: NOTIFY c2, 'payload'; ...@@ -8,9 +8,11 @@ step notify2: NOTIFY c2, 'payload';
notifier: NOTIFY "c2" with payload "payload" from notifier notifier: NOTIFY "c2" with payload "payload" from notifier
step notify3: NOTIFY c3, 'payload3'; step notify3: NOTIFY c3, 'payload3';
step notifyf: SELECT pg_notify('c2', NULL); step notifyf: SELECT pg_notify('c2', NULL);
pg_notify pg_notify
---------
(1 row)
notifier: NOTIFY "c2" with payload "" from notifier notifier: NOTIFY "c2" with payload "" from notifier
starting permutation: listenc notifyd1 notifyd2 notifys1 starting permutation: listenc notifyd1 notifyd2 notifys1
...@@ -51,13 +53,17 @@ step notify1: NOTIFY c1; ...@@ -51,13 +53,17 @@ step notify1: NOTIFY c1;
step notify2: NOTIFY c2, 'payload'; step notify2: NOTIFY c2, 'payload';
step notify3: NOTIFY c3, 'payload3'; step notify3: NOTIFY c3, 'payload3';
step notifyf: SELECT pg_notify('c2', NULL); step notifyf: SELECT pg_notify('c2', NULL);
pg_notify pg_notify
---------
(1 row)
step lcheck: SELECT 1 AS x; step lcheck: SELECT 1 AS x;
x x
-
1
(1 row)
1
listener: NOTIFY "c1" with payload "" from notifier listener: NOTIFY "c1" with payload "" from notifier
listener: NOTIFY "c2" with payload "payload" from notifier listener: NOTIFY "c2" with payload "payload" from notifier
listener: NOTIFY "c2" with payload "" from notifier listener: NOTIFY "c2" with payload "" from notifier
...@@ -71,14 +77,18 @@ step notify2: NOTIFY c2, 'payload'; ...@@ -71,14 +77,18 @@ step notify2: NOTIFY c2, 'payload';
notifier: NOTIFY "c2" with payload "payload" from notifier notifier: NOTIFY "c2" with payload "payload" from notifier
step notify3: NOTIFY c3, 'payload3'; step notify3: NOTIFY c3, 'payload3';
step notifyf: SELECT pg_notify('c2', NULL); step notifyf: SELECT pg_notify('c2', NULL);
pg_notify pg_notify
---------
(1 row)
notifier: NOTIFY "c2" with payload "" from notifier notifier: NOTIFY "c2" with payload "" from notifier
step lcheck: SELECT 1 AS x; step lcheck: SELECT 1 AS x;
x x
-
1
(1 row)
1
listener: NOTIFY "c1" with payload "" from notifier listener: NOTIFY "c1" with payload "" from notifier
listener: NOTIFY "c2" with payload "payload" from notifier listener: NOTIFY "c2" with payload "payload" from notifier
listener: NOTIFY "c2" with payload "" from notifier listener: NOTIFY "c2" with payload "" from notifier
...@@ -98,14 +108,20 @@ starting permutation: llisten lbegin usage bignotify usage ...@@ -98,14 +108,20 @@ starting permutation: llisten lbegin usage bignotify usage
step llisten: LISTEN c1; LISTEN c2; step llisten: LISTEN c1; LISTEN c2;
step lbegin: BEGIN; step lbegin: BEGIN;
step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero; step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
nonzero nonzero
-------
f
(1 row)
f
step bignotify: SELECT count(pg_notify('c1', s::text)) FROM generate_series(1, 1000) s; step bignotify: SELECT count(pg_notify('c1', s::text)) FROM generate_series(1, 1000) s;
count count
-----
1000
(1 row)
1000
step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero; step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
nonzero nonzero
-------
t
(1 row)
t
...@@ -6,9 +6,11 @@ step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); ...@@ -6,9 +6,11 @@ step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s1c: COMMIT; step s1c: COMMIT;
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
...@@ -18,9 +20,11 @@ step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); ...@@ -18,9 +20,11 @@ step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2a: BEGIN; step s2a: BEGIN;
step s1c: COMMIT; step s1c: COMMIT;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
...@@ -29,9 +33,11 @@ step s1a: BEGIN; ...@@ -29,9 +33,11 @@ step s1a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
...@@ -41,9 +47,11 @@ step s1a: BEGIN; ...@@ -41,9 +47,11 @@ step s1a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...> step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
step s2c: <... completed> step s2c: <... completed>
...@@ -55,9 +63,11 @@ step s2a: BEGIN; ...@@ -55,9 +63,11 @@ step s2a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s1c: COMMIT; step s1c: COMMIT;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
...@@ -66,9 +76,11 @@ step s1a: BEGIN; ...@@ -66,9 +76,11 @@ step s1a: BEGIN;
step s2a: BEGIN; step s2a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
...@@ -78,9 +90,11 @@ step s1a: BEGIN; ...@@ -78,9 +90,11 @@ step s1a: BEGIN;
step s2a: BEGIN; step s2a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...> step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
step s2c: <... completed> step s2c: <... completed>
...@@ -90,9 +104,11 @@ starting permutation: s1a s2a s2b s1b s1c s2c s2d ...@@ -90,9 +104,11 @@ starting permutation: s1a s2a s2b s1b s1c s2c s2d
step s1a: BEGIN; step s1a: BEGIN;
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s1c: COMMIT; step s1c: COMMIT;
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
...@@ -102,9 +118,11 @@ starting permutation: s1a s2a s2b s1b s2c s1c s2d ...@@ -102,9 +118,11 @@ starting permutation: s1a s2a s2b s1b s2c s1c s2d
step s1a: BEGIN; step s1a: BEGIN;
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...> step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
...@@ -115,9 +133,11 @@ starting permutation: s1a s2a s2b s2c s1b s2d s1c ...@@ -115,9 +133,11 @@ starting permutation: s1a s2a s2b s2c s1b s2d s1c
step s1a: BEGIN; step s1a: BEGIN;
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); <waiting ...> step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); <waiting ...>
step s2d: COMMIT; step s2d: COMMIT;
...@@ -128,9 +148,11 @@ starting permutation: s1a s2a s2b s2c s2d s1b s1c ...@@ -128,9 +148,11 @@ starting permutation: s1a s2a s2b s2c s2d s1b s1c
step s1a: BEGIN; step s1a: BEGIN;
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
...@@ -142,9 +164,11 @@ step s1a: BEGIN; ...@@ -142,9 +164,11 @@ step s1a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s1c: COMMIT; step s1c: COMMIT;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
...@@ -153,9 +177,11 @@ step s2a: BEGIN; ...@@ -153,9 +177,11 @@ step s2a: BEGIN;
step s1a: BEGIN; step s1a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
...@@ -165,9 +191,11 @@ step s2a: BEGIN; ...@@ -165,9 +191,11 @@ step s2a: BEGIN;
step s1a: BEGIN; step s1a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...> step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
step s2c: <... completed> step s2c: <... completed>
...@@ -177,9 +205,11 @@ starting permutation: s2a s1a s2b s1b s1c s2c s2d ...@@ -177,9 +205,11 @@ starting permutation: s2a s1a s2b s1b s1c s2c s2d
step s2a: BEGIN; step s2a: BEGIN;
step s1a: BEGIN; step s1a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s1c: COMMIT; step s1c: COMMIT;
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
...@@ -189,9 +219,11 @@ starting permutation: s2a s1a s2b s1b s2c s1c s2d ...@@ -189,9 +219,11 @@ starting permutation: s2a s1a s2b s1b s2c s1c s2d
step s2a: BEGIN; step s2a: BEGIN;
step s1a: BEGIN; step s1a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...> step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
...@@ -202,9 +234,11 @@ starting permutation: s2a s1a s2b s2c s1b s2d s1c ...@@ -202,9 +234,11 @@ starting permutation: s2a s1a s2b s2c s1b s2d s1c
step s2a: BEGIN; step s2a: BEGIN;
step s1a: BEGIN; step s1a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); <waiting ...> step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); <waiting ...>
step s2d: COMMIT; step s2d: COMMIT;
...@@ -215,9 +249,11 @@ starting permutation: s2a s1a s2b s2c s2d s1b s1c ...@@ -215,9 +249,11 @@ starting permutation: s2a s1a s2b s2c s2d s1b s1c
step s2a: BEGIN; step s2a: BEGIN;
step s1a: BEGIN; step s1a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
...@@ -226,9 +262,11 @@ step s1c: COMMIT; ...@@ -226,9 +262,11 @@ step s1c: COMMIT;
starting permutation: s2a s2b s1a s1b s1c s2c s2d starting permutation: s2a s2b s1a s1b s1c s2c s2d
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1a: BEGIN; step s1a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s1c: COMMIT; step s1c: COMMIT;
...@@ -238,9 +276,11 @@ step s2d: COMMIT; ...@@ -238,9 +276,11 @@ step s2d: COMMIT;
starting permutation: s2a s2b s1a s1b s2c s1c s2d starting permutation: s2a s2b s1a s1b s2c s1c s2d
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1a: BEGIN; step s1a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f();
step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...> step s2c: UPDATE a SET i = 4 WHERE i = 3; <waiting ...>
...@@ -251,9 +291,11 @@ step s2d: COMMIT; ...@@ -251,9 +291,11 @@ step s2d: COMMIT;
starting permutation: s2a s2b s1a s2c s1b s2d s1c starting permutation: s2a s2b s1a s2c s1b s2d s1c
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1a: BEGIN; step s1a: BEGIN;
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); <waiting ...> step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); <waiting ...>
...@@ -264,9 +306,11 @@ step s1c: COMMIT; ...@@ -264,9 +306,11 @@ step s1c: COMMIT;
starting permutation: s2a s2b s1a s2c s2d s1b s1c starting permutation: s2a s2b s1a s2c s2d s1b s1c
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s1a: BEGIN; step s1a: BEGIN;
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
...@@ -276,9 +320,11 @@ step s1c: COMMIT; ...@@ -276,9 +320,11 @@ step s1c: COMMIT;
starting permutation: s2a s2b s2c s1a s1b s2d s1c starting permutation: s2a s2b s2c s1a s1b s2d s1c
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s1a: BEGIN; step s1a: BEGIN;
step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); <waiting ...> step s1b: CREATE TRIGGER t AFTER UPDATE ON a EXECUTE PROCEDURE f(); <waiting ...>
...@@ -289,9 +335,11 @@ step s1c: COMMIT; ...@@ -289,9 +335,11 @@ step s1c: COMMIT;
starting permutation: s2a s2b s2c s1a s2d s1b s1c starting permutation: s2a s2b s2c s1a s2d s1b s1c
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s1a: BEGIN; step s1a: BEGIN;
step s2d: COMMIT; step s2d: COMMIT;
...@@ -301,9 +349,11 @@ step s1c: COMMIT; ...@@ -301,9 +349,11 @@ step s1c: COMMIT;
starting permutation: s2a s2b s2c s2d s1a s1b s1c starting permutation: s2a s2b s2c s2d s1a s1b s1c
step s2a: BEGIN; step s2a: BEGIN;
step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE; step s2b: SELECT * FROM a WHERE i = 1 FOR UPDATE;
i i
-
1
(1 row)
1
step s2c: UPDATE a SET i = 4 WHERE i = 3; step s2c: UPDATE a SET i = 4 WHERE i = 3;
step s2d: COMMIT; step s2d: COMMIT;
step s1a: BEGIN; step s1a: BEGIN;
......
...@@ -2,13 +2,17 @@ Parsed test spec with 4 sessions ...@@ -2,13 +2,17 @@ Parsed test spec with 4 sessions
starting permutation: d1a1 d2a2 e1l e2l d1a2 d2a1 d1c e1c d2c e2c starting permutation: d1a1 d2a2 e1l e2l d1a2 d2a1 d1c e1c d2c e2c
step d1a1: SELECT lock_share(1,x), lock_excl(3,x) FROM bigt LIMIT 1; step d1a1: SELECT lock_share(1,x), lock_excl(3,x) FROM bigt LIMIT 1;
lock_share lock_excl lock_share|lock_excl
----------+---------
1| 1
(1 row)
1 1
step d2a2: select lock_share(2,x) FROM bigt LIMIT 1; step d2a2: select lock_share(2,x) FROM bigt LIMIT 1;
lock_share lock_share
----------
1
(1 row)
1
step e1l: SELECT lock_excl(1,x) FROM bigt LIMIT 1; <waiting ...> step e1l: SELECT lock_excl(1,x) FROM bigt LIMIT 1; <waiting ...>
step e2l: SELECT lock_excl(2,x) FROM bigt LIMIT 1; <waiting ...> step e2l: SELECT lock_excl(2,x) FROM bigt LIMIT 1; <waiting ...>
step d1a2: SET force_parallel_mode = on; step d1a2: SET force_parallel_mode = on;
...@@ -30,25 +34,35 @@ step d2a1: SET force_parallel_mode = on; ...@@ -30,25 +34,35 @@ step d2a1: SET force_parallel_mode = on;
RESET parallel_tuple_cost; RESET parallel_tuple_cost;
SELECT lock_share(3,x) FROM bigt LIMIT 1; <waiting ...> SELECT lock_share(3,x) FROM bigt LIMIT 1; <waiting ...>
step d1a2: <... completed> step d1a2: <... completed>
sum sum
-----
10000
(1 row)
10000
step d1c: COMMIT; step d1c: COMMIT;
step e1l: <... completed> step e1l: <... completed>
lock_excl lock_excl
---------
1
(1 row)
1
step d2a1: <... completed> step d2a1: <... completed>
sum sum
-----
10000
(1 row)
10000 lock_share
lock_share ----------
1
(1 row)
1
step e1c: COMMIT; step e1c: COMMIT;
step d2c: COMMIT; step d2c: COMMIT;
step e2l: <... completed> step e2l: <... completed>
lock_excl lock_excl
---------
1
(1 row)
1
step e2c: COMMIT; step e2c: COMMIT;
...@@ -2,75 +2,99 @@ Parsed test spec with 2 sessions ...@@ -2,75 +2,99 @@ Parsed test spec with 2 sessions
starting permutation: s1l s1svp s1d s1r s2l s1c s2c starting permutation: s1l s1svp s1d s1r s2l s1c s2c
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: SELECT * FROM foo FOR NO KEY UPDATE; step s1d: SELECT * FROM foo FOR NO KEY UPDATE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...> step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s1l s1svp s1d s2l s1r s1c s2c starting permutation: s1l s1svp s1d s2l s1r s1c s2c
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: SELECT * FROM foo FOR NO KEY UPDATE; step s1d: SELECT * FROM foo FOR NO KEY UPDATE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...> step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1c: COMMIT; step s1c: COMMIT;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s1l s1svp s1d s1r s2l2 s1c s2c starting permutation: s1l s1svp s1d s1r s2l2 s1c s2c
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: SELECT * FROM foo FOR NO KEY UPDATE; step s1d: SELECT * FROM foo FOR NO KEY UPDATE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l2: SELECT * FROM foo FOR NO KEY UPDATE; step s2l2: SELECT * FROM foo FOR NO KEY UPDATE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s1l s1svp s1d s2l2 s1r s1c s2c starting permutation: s1l s1svp s1d s2l2 s1r s1c s2c
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: SELECT * FROM foo FOR NO KEY UPDATE; step s1d: SELECT * FROM foo FOR NO KEY UPDATE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2l2: SELECT * FROM foo FOR NO KEY UPDATE; <waiting ...> step s2l2: SELECT * FROM foo FOR NO KEY UPDATE; <waiting ...>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l2: <... completed> step s2l2: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
...@@ -2,94 +2,118 @@ Parsed test spec with 2 sessions ...@@ -2,94 +2,118 @@ Parsed test spec with 2 sessions
starting permutation: s1l s1svp s1d s1r s1c s2l s2c starting permutation: s1l s1svp s1d s1r s1c s2l s2c
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: DELETE FROM foo; step s1d: DELETE FROM foo;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1c: COMMIT; step s1c: COMMIT;
step s2l: SELECT * FROM foo FOR UPDATE; step s2l: SELECT * FROM foo FOR UPDATE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s1l s1svp s1d s1r s2l s1c s2c starting permutation: s1l s1svp s1d s1r s2l s1c s2c
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: DELETE FROM foo; step s1d: DELETE FROM foo;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...> step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s1l s1svp s1d s2l s1r s1c s2c starting permutation: s1l s1svp s1d s2l s1r s1c s2c
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: DELETE FROM foo; step s1d: DELETE FROM foo;
step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...> step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...>
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1c: COMMIT; step s1c: COMMIT;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s1l s1svp s2l s1d s1r s1c s2c starting permutation: s1l s1svp s2l s1d s1r s1c s2c
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...> step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...>
step s1d: DELETE FROM foo; step s1d: DELETE FROM foo;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1c: COMMIT; step s1c: COMMIT;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s1l s2l s1svp s1d s1r s1c s2c starting permutation: s1l s2l s1svp s1d s1r s1c s2c
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...> step s2l: SELECT * FROM foo FOR UPDATE; <waiting ...>
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: DELETE FROM foo; step s1d: DELETE FROM foo;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
step s1c: COMMIT; step s1c: COMMIT;
step s2l: <... completed> step s2l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
starting permutation: s2l s1l s2c s1svp s1d s1r s1c starting permutation: s2l s1l s2c s1svp s1d s1r s1c
step s2l: SELECT * FROM foo FOR UPDATE; step s2l: SELECT * FROM foo FOR UPDATE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1l: SELECT * FROM foo FOR KEY SHARE; <waiting ...> step s1l: SELECT * FROM foo FOR KEY SHARE; <waiting ...>
step s2c: COMMIT; step s2c: COMMIT;
step s1l: <... completed> step s1l: <... completed>
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: DELETE FROM foo; step s1d: DELETE FROM foo;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
...@@ -97,14 +121,18 @@ step s1c: COMMIT; ...@@ -97,14 +121,18 @@ step s1c: COMMIT;
starting permutation: s2l s2c s1l s1svp s1d s1r s1c starting permutation: s2l s2c s1l s1svp s1d s1r s1c
step s2l: SELECT * FROM foo FOR UPDATE; step s2l: SELECT * FROM foo FOR UPDATE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s2c: COMMIT; step s2c: COMMIT;
step s1l: SELECT * FROM foo FOR KEY SHARE; step s1l: SELECT * FROM foo FOR KEY SHARE;
key value key|value
---+-----
1| 1
(1 row)
1 1
step s1svp: SAVEPOINT f; step s1svp: SAVEPOINT f;
step s1d: DELETE FROM foo; step s1d: DELETE FROM foo;
step s1r: ROLLBACK TO f; step s1r: ROLLBACK TO f;
......
...@@ -3,10 +3,12 @@ Parsed test spec with 3 sessions ...@@ -3,10 +3,12 @@ Parsed test spec with 3 sessions
starting permutation: s1b s1s s2d s3i1 s1c starting permutation: s1b s1s s2d s3i1 s1c
step s1b: BEGIN; step s1b: BEGIN;
step s1s: SELECT * FROM d_lp_fk; step s1s: SELECT * FROM d_lp_fk;
a a
-
1
2
(2 rows)
1
2
step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY; <waiting ...> step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY; <waiting ...>
step s3i1: INSERT INTO d_lp_fk_r VALUES (1); step s3i1: INSERT INTO d_lp_fk_r VALUES (1);
ERROR: insert or update on table "d_lp_fk_r" violates foreign key constraint "d_lp_fk_r_a_fkey" ERROR: insert or update on table "d_lp_fk_r" violates foreign key constraint "d_lp_fk_r_a_fkey"
...@@ -16,10 +18,12 @@ step s2d: <... completed> ...@@ -16,10 +18,12 @@ step s2d: <... completed>
starting permutation: s1b s1s s2d s3i2 s3i2 s1c starting permutation: s1b s1s s2d s3i2 s3i2 s1c
step s1b: BEGIN; step s1b: BEGIN;
step s1s: SELECT * FROM d_lp_fk; step s1s: SELECT * FROM d_lp_fk;
a a
-
1
2
(2 rows)
1
2
step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY; <waiting ...> step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY; <waiting ...>
step s3i2: INSERT INTO d_lp_fk_r VALUES (2); step s3i2: INSERT INTO d_lp_fk_r VALUES (2);
step s3i2: INSERT INTO d_lp_fk_r VALUES (2); step s3i2: INSERT INTO d_lp_fk_r VALUES (2);
...@@ -29,10 +33,12 @@ step s2d: <... completed> ...@@ -29,10 +33,12 @@ step s2d: <... completed>
starting permutation: s1b s1s s3i1 s2d s1c starting permutation: s1b s1s s3i1 s2d s1c
step s1b: BEGIN; step s1b: BEGIN;
step s1s: SELECT * FROM d_lp_fk; step s1s: SELECT * FROM d_lp_fk;
a a
-
1
2
(2 rows)
1
2
step s3i1: INSERT INTO d_lp_fk_r VALUES (1); step s3i1: INSERT INTO d_lp_fk_r VALUES (1);
step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY; step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY;
ERROR: removing partition "d_lp_fk_1" violates foreign key constraint "d_lp_fk_r_a_fkey1" ERROR: removing partition "d_lp_fk_1" violates foreign key constraint "d_lp_fk_r_a_fkey1"
...@@ -41,10 +47,12 @@ step s1c: COMMIT; ...@@ -41,10 +47,12 @@ step s1c: COMMIT;
starting permutation: s1b s1s s3i2 s2d s1c starting permutation: s1b s1s s3i2 s2d s1c
step s1b: BEGIN; step s1b: BEGIN;
step s1s: SELECT * FROM d_lp_fk; step s1s: SELECT * FROM d_lp_fk;
a a
-
1
2
(2 rows)
1
2
step s3i2: INSERT INTO d_lp_fk_r VALUES (2); step s3i2: INSERT INTO d_lp_fk_r VALUES (2);
step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY; <waiting ...> step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY; <waiting ...>
step s1c: COMMIT; step s1c: COMMIT;
...@@ -53,10 +61,12 @@ step s2d: <... completed> ...@@ -53,10 +61,12 @@ step s2d: <... completed>
starting permutation: s1b s1s s3b s2d s3i1 s1c s3c starting permutation: s1b s1s s3b s2d s3i1 s1c s3c
step s1b: BEGIN; step s1b: BEGIN;
step s1s: SELECT * FROM d_lp_fk; step s1s: SELECT * FROM d_lp_fk;
a a
-
1
2
(2 rows)
1
2
step s3b: BEGIN; step s3b: BEGIN;
step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY; <waiting ...> step s2d: ALTER TABLE d_lp_fk DETACH PARTITION d_lp_fk_1 CONCURRENTLY; <waiting ...>
step s3i1: INSERT INTO d_lp_fk_r VALUES (1); step s3i1: INSERT INTO d_lp_fk_r VALUES (1);
......
...@@ -4,41 +4,53 @@ starting permutation: noseq chkiso prepi preps begin explaini explains select2 d ...@@ -4,41 +4,53 @@ starting permutation: noseq chkiso prepi preps begin explaini explains select2 d
step noseq: SET enable_seqscan = false; step noseq: SET enable_seqscan = false;
step chkiso: SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation'; step chkiso: SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation';
is_read_committed is_read_committed
-----------------
t
(1 row)
t
step prepi: PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data; step prepi: PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
step preps: PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data; step preps: PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data;
step begin: BEGIN; step begin: BEGIN;
step explaini: EXPLAIN (COSTS OFF) EXECUTE getrow_idx; step explaini: EXPLAIN (COSTS OFF) EXECUTE getrow_idx;
QUERY PLAN QUERY PLAN
----------------------------------------------
Sort Sort
Sort Key: id Sort Key: id
-> Index Scan using test_dc_data on test_dc -> Index Scan using test_dc_data on test_dc
Index Cond: (data = 34) Index Cond: (data = 34)
step explains: EXPLAIN (COSTS OFF) EXECUTE getrow_seq; (4 rows)
QUERY PLAN
Sort step explains: EXPLAIN (COSTS OFF) EXECUTE getrow_seq;
Sort Key: id, data QUERY PLAN
----------------------------------------------
Sort
Sort Key: id, data
-> Index Scan using test_dc_pkey on test_dc -> Index Scan using test_dc_pkey on test_dc
Filter: ((data)::text = '34'::text) Filter: ((data)::text = '34'::text)
(4 rows)
step select2: SELECT * FROM test_dc WHERE data=34 ORDER BY id,data; step select2: SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
id data id|data
--+----
34| 34
(1 row)
34 34
step drop: DROP INDEX CONCURRENTLY test_dc_data; <waiting ...> step drop: DROP INDEX CONCURRENTLY test_dc_data; <waiting ...>
step insert2: INSERT INTO test_dc(data) SELECT * FROM generate_series(1, 100); step insert2: INSERT INTO test_dc(data) SELECT * FROM generate_series(1, 100);
step end2: COMMIT; step end2: COMMIT;
step selecti: EXECUTE getrow_idx; step selecti: EXECUTE getrow_idx;
id data id|data
---+----
34| 34
134| 34
(2 rows)
34 34
134 34
step selects: EXECUTE getrow_seq; step selects: EXECUTE getrow_seq;
id data id|data
---+----
34| 34
134| 34
(2 rows)
34 34
134 34
step end: COMMIT; step end: COMMIT;
step drop: <... completed> step drop: <... completed>
...@@ -4,39 +4,51 @@ starting permutation: noseq chkiso prepi preps begin explaini explains select2 d ...@@ -4,39 +4,51 @@ starting permutation: noseq chkiso prepi preps begin explaini explains select2 d
step noseq: SET enable_seqscan = false; step noseq: SET enable_seqscan = false;
step chkiso: SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation'; step chkiso: SELECT (setting in ('read committed','read uncommitted')) AS is_read_committed FROM pg_settings WHERE name = 'default_transaction_isolation';
is_read_committed is_read_committed
-----------------
f
(1 row)
f
step prepi: PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data; step prepi: PREPARE getrow_idx AS SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
step preps: PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data; step preps: PREPARE getrow_seq AS SELECT * FROM test_dc WHERE data::text=34::text ORDER BY id,data;
step begin: BEGIN; step begin: BEGIN;
step explaini: EXPLAIN (COSTS OFF) EXECUTE getrow_idx; step explaini: EXPLAIN (COSTS OFF) EXECUTE getrow_idx;
QUERY PLAN QUERY PLAN
----------------------------------------------
Sort Sort
Sort Key: id Sort Key: id
-> Index Scan using test_dc_data on test_dc -> Index Scan using test_dc_data on test_dc
Index Cond: (data = 34) Index Cond: (data = 34)
step explains: EXPLAIN (COSTS OFF) EXECUTE getrow_seq; (4 rows)
QUERY PLAN
Sort step explains: EXPLAIN (COSTS OFF) EXECUTE getrow_seq;
Sort Key: id, data QUERY PLAN
----------------------------------------------
Sort
Sort Key: id, data
-> Index Scan using test_dc_pkey on test_dc -> Index Scan using test_dc_pkey on test_dc
Filter: ((data)::text = '34'::text) Filter: ((data)::text = '34'::text)
(4 rows)
step select2: SELECT * FROM test_dc WHERE data=34 ORDER BY id,data; step select2: SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
id data id|data
--+----
34| 34
(1 row)
34 34
step drop: DROP INDEX CONCURRENTLY test_dc_data; <waiting ...> step drop: DROP INDEX CONCURRENTLY test_dc_data; <waiting ...>
step insert2: INSERT INTO test_dc(data) SELECT * FROM generate_series(1, 100); step insert2: INSERT INTO test_dc(data) SELECT * FROM generate_series(1, 100);
step end2: COMMIT; step end2: COMMIT;
step selecti: EXECUTE getrow_idx; step selecti: EXECUTE getrow_idx;
id data id|data
--+----
34| 34
(1 row)
34 34
step selects: EXECUTE getrow_seq; step selects: EXECUTE getrow_seq;
id data id|data
--+----
34| 34
(1 row)
34 34
step end: COMMIT; step end: COMMIT;
step drop: <... completed> step drop: <... completed>
This diff is collapsed.
...@@ -6,9 +6,11 @@ step donothing2: INSERT INTO ints(key, val) VALUES(1, 'donothing2') ON CONFLICT ...@@ -6,9 +6,11 @@ step donothing2: INSERT INTO ints(key, val) VALUES(1, 'donothing2') ON CONFLICT
step c1: COMMIT; step c1: COMMIT;
step donothing2: <... completed> step donothing2: <... completed>
step select2: SELECT * FROM ints; step select2: SELECT * FROM ints;
key val key|val
---+----------
1|donothing1
(1 row)
1 donothing1
step c2: COMMIT; step c2: COMMIT;
starting permutation: donothing1 donothing2 a1 select2 c2 starting permutation: donothing1 donothing2 a1 select2 c2
...@@ -17,7 +19,9 @@ step donothing2: INSERT INTO ints(key, val) VALUES(1, 'donothing2') ON CONFLICT ...@@ -17,7 +19,9 @@ step donothing2: INSERT INTO ints(key, val) VALUES(1, 'donothing2') ON CONFLICT
step a1: ABORT; step a1: ABORT;
step donothing2: <... completed> step donothing2: <... completed>
step select2: SELECT * FROM ints; step select2: SELECT * FROM ints;
key val key|val
---+----------
1|donothing2
(1 row)
1 donothing2
step c2: COMMIT; step c2: COMMIT;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment