Parsed test spec with 2 sessions

starting permutation: s2-begin s2-update-table-1 s1-begin s1-view-locks s1-rollback s2-rollback s1-view-locks
step s2-begin:
 BEGIN;

step s2-update-table-1:
    UPDATE ref_table_1 SET id = 2 WHERE id = 1;

step s1-begin:
 BEGIN;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|  objid|objsubid|mode         |application_name                           |backend_type  |query
---------------------------------------------------------------------
      0|8429800|       4|ShareLock    |isolation/isolation_ref2ref_foreign_keys/s2|client backend|     UPDATE ref_table_1 SET id = 2 WHERE id = 1;
      0|8429800|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     UPDATE ref_table_1 SET id = 2 WHERE id = 1;
(2 rows)

step s1-rollback:
    ROLLBACK;

step s2-rollback:
    ROLLBACK;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|objid|objsubid|mode|application_name|backend_type|query
---------------------------------------------------------------------
(0 rows)


starting permutation: s2-begin s2-delete-table-1 s1-view-locks s2-rollback s1-view-locks
step s2-begin:
 BEGIN;

step s2-delete-table-1:
    DELETE FROM ref_table_1 WHERE id = 1;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|  objid|objsubid|mode         |application_name                           |backend_type  |query
---------------------------------------------------------------------
      0|8429800|       4|ShareLock    |isolation/isolation_ref2ref_foreign_keys/s2|client backend|     DELETE FROM ref_table_1 WHERE id = 1;
      0|8429800|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     DELETE FROM ref_table_1 WHERE id = 1;
(2 rows)

step s2-rollback:
    ROLLBACK;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|objid|objsubid|mode|application_name|backend_type|query
---------------------------------------------------------------------
(0 rows)


starting permutation: s2-begin s2-update-table-2 s1-view-locks s2-rollback s1-view-locks
step s2-begin:
 BEGIN;

step s2-update-table-2:
    UPDATE ref_table_2 SET id = 2 WHERE id = 1;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|  objid|objsubid|mode         |application_name                           |backend_type  |query
---------------------------------------------------------------------
      0|8429800|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     UPDATE ref_table_2 SET id = 2 WHERE id = 1;
      0|8429801|       4|ShareLock    |isolation/isolation_ref2ref_foreign_keys/s2|client backend|     UPDATE ref_table_2 SET id = 2 WHERE id = 1;
      0|8429801|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     UPDATE ref_table_2 SET id = 2 WHERE id = 1;
(3 rows)

step s2-rollback:
    ROLLBACK;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|objid|objsubid|mode|application_name|backend_type|query
---------------------------------------------------------------------
(0 rows)


starting permutation: s2-begin s2-delete-table-2 s1-view-locks s2-rollback s1-view-locks
step s2-begin:
 BEGIN;

step s2-delete-table-2:
    DELETE FROM ref_table_2 WHERE id = 1;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|  objid|objsubid|mode         |application_name                           |backend_type  |query
---------------------------------------------------------------------
      0|8429800|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     DELETE FROM ref_table_2 WHERE id = 1;
      0|8429801|       4|ShareLock    |isolation/isolation_ref2ref_foreign_keys/s2|client backend|     DELETE FROM ref_table_2 WHERE id = 1;
      0|8429801|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     DELETE FROM ref_table_2 WHERE id = 1;
(3 rows)

step s2-rollback:
    ROLLBACK;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|objid|objsubid|mode|application_name|backend_type|query
---------------------------------------------------------------------
(0 rows)


starting permutation: s2-begin s2-update-table-3 s1-begin s1-view-locks s1-rollback s2-rollback s1-view-locks
step s2-begin:
 BEGIN;

step s2-update-table-3:
    UPDATE ref_table_3 SET id = 2 WHERE id = 1;

step s1-begin:
 BEGIN;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|  objid|objsubid|mode         |application_name                           |backend_type  |query
---------------------------------------------------------------------
      0|8429800|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     UPDATE ref_table_3 SET id = 2 WHERE id = 1;
      0|8429801|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     UPDATE ref_table_3 SET id = 2 WHERE id = 1;
      0|8429802|       4|ShareLock    |isolation/isolation_ref2ref_foreign_keys/s2|client backend|     UPDATE ref_table_3 SET id = 2 WHERE id = 1;
      0|8429802|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     UPDATE ref_table_3 SET id = 2 WHERE id = 1;
(4 rows)

step s1-rollback:
    ROLLBACK;

step s2-rollback:
    ROLLBACK;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|objid|objsubid|mode|application_name|backend_type|query
---------------------------------------------------------------------
(0 rows)


starting permutation: s2-begin s2-delete-table-3 s1-begin s1-view-locks s1-rollback s2-rollback s1-view-locks
step s2-begin:
 BEGIN;

step s2-delete-table-3:
    DELETE FROM ref_table_3 WHERE id = 1;

step s1-begin:
 BEGIN;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|  objid|objsubid|mode         |application_name                           |backend_type  |query
---------------------------------------------------------------------
      0|8429800|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     DELETE FROM ref_table_3 WHERE id = 1;
      0|8429801|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     DELETE FROM ref_table_3 WHERE id = 1;
      0|8429802|       4|ShareLock    |isolation/isolation_ref2ref_foreign_keys/s2|client backend|     DELETE FROM ref_table_3 WHERE id = 1;
      0|8429802|       5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     DELETE FROM ref_table_3 WHERE id = 1;
(4 rows)

step s1-rollback:
    ROLLBACK;

step s2-rollback:
    ROLLBACK;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|objid|objsubid|mode|application_name|backend_type|query
---------------------------------------------------------------------
(0 rows)


starting permutation: s2-begin s2-insert-table-1 s1-view-locks s2-rollback s1-view-locks
step s2-begin:
 BEGIN;

step s2-insert-table-1:
    INSERT INTO ref_table_1 VALUES (7, 7);

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|  objid|objsubid|mode            |application_name                           |backend_type  |query
---------------------------------------------------------------------
      0|8429800|       4|ShareLock       |isolation/isolation_ref2ref_foreign_keys/s2|client backend|     INSERT INTO ref_table_1 VALUES (7, 7);
      0|8429800|       5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     INSERT INTO ref_table_1 VALUES (7, 7);
(2 rows)

step s2-rollback:
    ROLLBACK;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|objid|objsubid|mode|application_name|backend_type|query
---------------------------------------------------------------------
(0 rows)


starting permutation: s2-begin s2-insert-table-2 s1-view-locks s2-rollback s1-view-locks
step s2-begin:
 BEGIN;

step s2-insert-table-2:
    INSERT INTO ref_table_2 VALUES (7, 5);

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|  objid|objsubid|mode            |application_name                           |backend_type  |query
---------------------------------------------------------------------
      0|8429800|       5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     INSERT INTO ref_table_2 VALUES (7, 5);
      0|8429801|       4|ShareLock       |isolation/isolation_ref2ref_foreign_keys/s2|client backend|     INSERT INTO ref_table_2 VALUES (7, 5);
      0|8429801|       5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     INSERT INTO ref_table_2 VALUES (7, 5);
(3 rows)

step s2-rollback:
    ROLLBACK;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|objid|objsubid|mode|application_name|backend_type|query
---------------------------------------------------------------------
(0 rows)


starting permutation: s2-begin s2-insert-table-3 s1-view-locks s2-rollback s1-view-locks
step s2-begin:
 BEGIN;

step s2-insert-table-3:
    INSERT INTO ref_table_3 VALUES (7, 5);

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|  objid|objsubid|mode            |application_name                           |backend_type  |query
---------------------------------------------------------------------
      0|8429800|       5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     INSERT INTO ref_table_3 VALUES (7, 5);
      0|8429801|       5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     INSERT INTO ref_table_3 VALUES (7, 5);
      0|8429802|       4|ShareLock       |isolation/isolation_ref2ref_foreign_keys/s2|client backend|     INSERT INTO ref_table_3 VALUES (7, 5);
      0|8429802|       5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend|     INSERT INTO ref_table_3 VALUES (7, 5);
(4 rows)

step s2-rollback:
    ROLLBACK;

step s1-view-locks:
    -- The following output changed in PG versions 13.6 and 14.2. The output is expected
    -- to change in earlier versions of PG as the and application_name format did not use
    -- to include session name at the end.
    SELECT classid,
        objid,
        objsubid,
        mode,
        application_name,
        backend_type,
        regexp_replace(query, E'[\\n\\r\\u2028]+', ' ', 'g' ) query
    FROM pg_locks l
    JOIN pg_stat_activity a
    ON l.pid = a.pid
    WHERE locktype='advisory'
        AND application_name <> 'Citus Maintenance Daemon'
    ORDER BY 1, 2, 3, 4;

classid|objid|objsubid|mode|application_name|backend_type|query
---------------------------------------------------------------------
(0 rows)


starting permutation: s1-begin s2-begin s2-update-table-1 s1-delete-table-2 s2-commit s1-commit s1-select-table-2
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-update-table-1:
    UPDATE ref_table_1 SET id = 2 WHERE id = 1;

step s1-delete-table-2:
    DELETE FROM ref_table_2 WHERE value = 2;
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-delete-table-2: <... completed>
step s1-commit:
    COMMIT;

step s1-select-table-2:
    SELECT * FROM ref_table_2 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 3|    3
 5|    5
(2 rows)


starting permutation: s1-begin s2-begin s2-update-table-1 s1-insert-table-2 s2-commit s1-commit s1-select-table-2
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-update-table-1:
    UPDATE ref_table_1 SET id = 2 WHERE id = 1;

step s1-insert-table-2:
    INSERT INTO ref_table_2 VALUES (7, 2);
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-insert-table-2: <... completed>
step s1-commit:
    COMMIT;

step s1-select-table-2:
    SELECT * FROM ref_table_2 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    2
 3|    3
 5|    5
 7|    2
(4 rows)


starting permutation: s1-begin s2-begin s2-update-table-1 s1-update-table-2 s2-commit s1-commit s1-select-table-2
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-update-table-1:
    UPDATE ref_table_1 SET id = 2 WHERE id = 1;

step s1-update-table-2:
    UPDATE ref_table_2 SET id = 0 WHERE value = 2;
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-update-table-2: <... completed>
step s1-commit:
    COMMIT;

step s1-select-table-2:
    SELECT * FROM ref_table_2 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 0|    2
 3|    3
 5|    5
(3 rows)


starting permutation: s1-begin s2-begin s2-delete-table-1 s1-delete-table-2 s2-commit s1-commit s1-select-table-2
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete-table-1:
    DELETE FROM ref_table_1 WHERE id = 1;

step s1-delete-table-2:
    DELETE FROM ref_table_2 WHERE value = 2;
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-delete-table-2: <... completed>
step s1-commit:
    COMMIT;

step s1-select-table-2:
    SELECT * FROM ref_table_2 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 3|    3
 5|    5
(2 rows)


starting permutation: s1-begin s2-begin s2-delete-table-1 s1-insert-table-2 s2-commit s1-commit s1-select-table-2
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete-table-1:
    DELETE FROM ref_table_1 WHERE id = 1;

step s1-insert-table-2:
    INSERT INTO ref_table_2 VALUES (7, 2);
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-insert-table-2: <... completed>
ERROR:  insert or update on table "ref_table_2_xxxxxxx" violates foreign key constraint "ref_table_2_value_fkey_xxxxxxx"
step s1-commit:
    COMMIT;

step s1-select-table-2:
    SELECT * FROM ref_table_2 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 3|    3
 5|    5
(2 rows)


starting permutation: s1-begin s2-begin s2-delete-table-1 s1-update-table-2 s2-commit s1-commit s1-select-table-2
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete-table-1:
    DELETE FROM ref_table_1 WHERE id = 1;

step s1-update-table-2:
    UPDATE ref_table_2 SET id = 0 WHERE value = 2;
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-update-table-2: <... completed>
step s1-commit:
    COMMIT;

step s1-select-table-2:
    SELECT * FROM ref_table_2 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 3|    3
 5|    5
(2 rows)


starting permutation: s1-begin s2-begin s2-delete-table-1 s1-delete-table-3 s2-commit s1-commit s1-select-table-3
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete-table-1:
    DELETE FROM ref_table_1 WHERE id = 1;

step s1-delete-table-3:
    DELETE FROM ref_table_3 WHERE value = 1 RETURNING id;
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-delete-table-3: <... completed>
id
--
(0 rows)

step s1-commit:
    COMMIT;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 3|    3
 5|    5
(2 rows)


starting permutation: s1-begin s2-begin s2-delete-table-1 s1-insert-table-3 s2-commit s1-commit s1-select-table-3
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete-table-1:
    DELETE FROM ref_table_1 WHERE id = 1;

step s1-insert-table-3:
    INSERT INTO ref_table_3 VALUES (7, 1);
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-insert-table-3: <... completed>
ERROR:  insert or update on table "ref_table_3_xxxxxxx" violates foreign key constraint "ref_table_3_value_fkey_xxxxxxx"
step s1-commit:
    COMMIT;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 3|    3
 5|    5
(2 rows)


starting permutation: s1-begin s2-begin s2-delete-table-1 s1-update-table-3 s2-commit s1-commit s1-select-table-3
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete-table-1:
    DELETE FROM ref_table_1 WHERE id = 1;

step s1-update-table-3:
    UPDATE ref_table_3 SET id = 2 WHERE value = 1 RETURNING id;
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-update-table-3: <... completed>
id
--
(0 rows)

step s1-commit:
    COMMIT;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 3|    3
 5|    5
(2 rows)


starting permutation: s1-begin s2-begin s2-insert-table-1 s1-update-table-3 s2-commit s1-commit s1-select-table-3
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-insert-table-1:
    INSERT INTO ref_table_1 VALUES (7, 7);

step s1-update-table-3:
    UPDATE ref_table_3 SET id = 2 WHERE value = 1 RETURNING id;
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-update-table-3: <... completed>
id
--
 2
(1 row)

step s1-commit:
    COMMIT;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 2|    1
 3|    3
 5|    5
(3 rows)


starting permutation: s1-begin s2-begin s1-update-table-3 s2-insert-table-1 s1-commit s2-commit s1-select-table-3
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s1-update-table-3:
    UPDATE ref_table_3 SET id = 2 WHERE value = 1 RETURNING id;

id
--
 2
(1 row)

step s2-insert-table-1:
    INSERT INTO ref_table_1 VALUES (7, 7);
 <waiting ...>
step s1-commit: 
    COMMIT;

step s2-insert-table-1: <... completed>
step s2-commit:
    COMMIT;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 2|    1
 3|    3
 5|    5
(3 rows)


starting permutation: s1-begin s2-begin s2-insert-table-1 s1-update-table-2 s2-commit s1-commit s1-select-table-3
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-insert-table-1:
    INSERT INTO ref_table_1 VALUES (7, 7);

step s1-update-table-2:
    UPDATE ref_table_2 SET id = 0 WHERE value = 2;
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-update-table-2: <... completed>
step s1-commit:
    COMMIT;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)


starting permutation: s1-begin s2-begin s1-update-table-2 s2-insert-table-1 s1-commit s2-commit s1-select-table-3
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s1-update-table-2:
    UPDATE ref_table_2 SET id = 0 WHERE value = 2;

step s2-insert-table-1:
    INSERT INTO ref_table_1 VALUES (7, 7);
 <waiting ...>
step s1-commit: 
    COMMIT;

step s2-insert-table-1: <... completed>
step s2-commit:
    COMMIT;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)


starting permutation: s1-begin s2-begin s2-insert-table-2 s1-update-table-3 s2-commit s1-commit s1-select-table-3
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-insert-table-2:
    INSERT INTO ref_table_2 VALUES (7, 5);

step s1-update-table-3:
    UPDATE ref_table_3 SET id = 2 WHERE value = 1 RETURNING id;
 <waiting ...>
step s2-commit: 
    COMMIT;

step s1-update-table-3: <... completed>
id
--
 2
(1 row)

step s1-commit:
    COMMIT;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 2|    1
 3|    3
 5|    5
(3 rows)


starting permutation: s1-begin s2-begin s1-update-table-3 s2-insert-table-2 s1-commit s2-commit s1-select-table-3
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s1-update-table-3:
    UPDATE ref_table_3 SET id = 2 WHERE value = 1 RETURNING id;

id
--
 2
(1 row)

step s2-insert-table-2:
    INSERT INTO ref_table_2 VALUES (7, 5);
 <waiting ...>
step s1-commit: 
    COMMIT;

step s2-insert-table-2: <... completed>
step s2-commit:
    COMMIT;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 2|    1
 3|    3
 5|    5
(3 rows)


starting permutation: s1-begin s2-begin s2-insert-table-1 s1-select-table-1 s2-commit s1-commit
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-insert-table-1:
    INSERT INTO ref_table_1 VALUES (7, 7);

step s1-select-table-1:
    SELECT * FROM ref_table_1 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)

step s2-commit:
    COMMIT;

step s1-commit:
    COMMIT;


starting permutation: s1-begin s2-begin s2-insert-table-1 s1-select-table-2 s2-commit s1-commit
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-insert-table-1:
    INSERT INTO ref_table_1 VALUES (7, 7);

step s1-select-table-2:
    SELECT * FROM ref_table_2 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)

step s2-commit:
    COMMIT;

step s1-commit:
    COMMIT;


starting permutation: s1-begin s2-begin s2-insert-table-1 s1-select-table-3 s2-commit s1-commit
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-insert-table-1:
    INSERT INTO ref_table_1 VALUES (7, 7);

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)

step s2-commit:
    COMMIT;

step s1-commit:
    COMMIT;


starting permutation: s1-begin s2-begin s2-delete-table-2 s1-select-table-1 s2-commit s1-commit
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete-table-2:
    DELETE FROM ref_table_2 WHERE id = 1;

step s1-select-table-1:
    SELECT * FROM ref_table_1 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)

step s2-commit:
    COMMIT;

step s1-commit:
    COMMIT;


starting permutation: s1-begin s2-begin s2-delete-table-2 s1-select-table-2 s2-commit s1-commit
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete-table-2:
    DELETE FROM ref_table_2 WHERE id = 1;

step s1-select-table-2:
    SELECT * FROM ref_table_2 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)

step s2-commit:
    COMMIT;

step s1-commit:
    COMMIT;


starting permutation: s1-begin s2-begin s2-delete-table-2 s1-select-table-3 s2-commit s1-commit
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete-table-2:
    DELETE FROM ref_table_2 WHERE id = 1;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)

step s2-commit:
    COMMIT;

step s1-commit:
    COMMIT;


starting permutation: s1-begin s2-begin s2-update-table-3 s1-select-table-1 s2-commit s1-commit
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-update-table-3:
    UPDATE ref_table_3 SET id = 2 WHERE id = 1;

step s1-select-table-1:
    SELECT * FROM ref_table_1 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)

step s2-commit:
    COMMIT;

step s1-commit:
    COMMIT;


starting permutation: s1-begin s2-begin s2-update-table-3 s1-select-table-2 s2-commit s1-commit
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-update-table-3:
    UPDATE ref_table_3 SET id = 2 WHERE id = 1;

step s1-select-table-2:
    SELECT * FROM ref_table_2 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)

step s2-commit:
    COMMIT;

step s1-commit:
    COMMIT;


starting permutation: s1-begin s2-begin s2-update-table-3 s1-select-table-3 s2-commit s1-commit
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-update-table-3:
    UPDATE ref_table_3 SET id = 2 WHERE id = 1;

step s1-select-table-3:
    SELECT * FROM ref_table_3 ORDER BY id, value;

id|value
---------------------------------------------------------------------
 1|    1
 3|    3
 5|    5
(3 rows)

step s2-commit:
    COMMIT;

step s1-commit:
    COMMIT;

