diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/select_distinct.out /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/select_distinct.out --- /tmp/cirrus-ci-build/src/test/regress/expected/select_distinct.out 2024-09-02 15:26:56.005767252 +0000 +++ /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/select_distinct.out 2024-09-02 15:32:43.052835406 +0000 @@ -262,14 +262,10 @@ -- Ensure we don't do parallel distinct with a parallel unsafe function EXPLAIN (COSTS OFF) SELECT DISTINCT distinct_func(1) FROM tenk1; - QUERY PLAN ----------------------------------------------------------- - Unique - -> Sort - Sort Key: (distinct_func(1)) - -> Index Only Scan using tenk1_hundred on tenk1 -(4 rows) - +ERROR: deadlock detected +DETAIL: Process 38777 waits for AccessShareLock on relation 24425 of database 16387; blocked by process 38772. +Process 38772 waits for AccessExclusiveLock on relation 16421 of database 16387; blocked by process 38777. +HINT: See server log for query details. -- make the function parallel safe CREATE OR REPLACE FUNCTION distinct_func(a INT) RETURNS INT AS $$ BEGIN diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/union.out /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/union.out --- /tmp/cirrus-ci-build/src/test/regress/expected/union.out 2024-09-02 15:26:56.025767253 +0000 +++ /tmp/cirrus-ci-build/src/bin/pg_upgrade/tmp_check/results/union.out 2024-09-02 15:32:43.164835336 +0000 @@ -1212,11 +1212,10 @@ UNION ALL SELECT 2 AS t, * FROM tenk1 b) c WHERE t = 2; - QUERY PLAN ---------------------- - Seq Scan on tenk1 b -(1 row) - +ERROR: deadlock detected +DETAIL: Process 38770 waits for AccessShareLock on relation 24425 of database 16387; blocked by process 38772. +Process 38772 waits for AccessExclusiveLock on relation 16421 of database 16387; blocked by process 38770. +HINT: See server log for query details. -- Test that we push quals into UNION sub-selects only when it's safe explain (costs off) SELECT * FROM