diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/select_distinct.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/select_distinct.out --- /tmp/cirrus-ci-build/src/test/regress/expected/select_distinct.out 2024-09-08 13:02:27.645155571 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/select_distinct.out 2024-09-08 13:09:49.932983297 +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 49003 waits for AccessShareLock on relation 24361 of database 16384; blocked by process 49005. +Process 49005 waits for AccessExclusiveLock on relation 16418 of database 16384; blocked by process 49003. +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/subselect.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/subselect.out --- /tmp/cirrus-ci-build/src/test/regress/expected/subselect.out 2024-09-08 13:02:27.653118948 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/subselect.out 2024-09-08 13:09:50.212984568 +0000 @@ -1029,7 +1029,7 @@ -> Seq Scan on tenk1 t Filter: ((ANY (unique2 = (hashed SubPlan 2).col1)) OR (ten < 0)) SubPlan 2 - -> Index Only Scan using tenk1_unique1 on tenk1 k + -> Index Only Scan using idx_int4 on tenk1 k (5 rows) select count(*) from tenk1 t @@ -1403,7 +1403,7 @@ -> Seq Scan on public.tenk1 b Output: b.unique1, b.unique2, b.two, b.four, b.ten, b.twenty, b.hundred, b.thousand, b.twothousand, b.fivethous, b.tenthous, b.odd, b.even, b.stringu1, b.stringu2, b.string4 SubPlan 1 - -> Index Only Scan using tenk1_unique1 on public.tenk1 a + -> Index Only Scan using idx_int4 on public.tenk1 a Output: a.unique1 (10 rows) diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/union.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/union.out --- /tmp/cirrus-ci-build/src/test/regress/expected/union.out 2024-09-08 13:02:27.665064012 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/union.out 2024-09-08 13:09:49.912983206 +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 49004 waits for AccessShareLock on relation 24361 of database 16384; blocked by process 49005. +Process 49005 waits for AccessExclusiveLock on relation 16418 of database 16384; blocked by process 49004. +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 diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/join.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/join.out --- /tmp/cirrus-ci-build/src/test/regress/expected/join.out 2024-09-08 13:02:27.609320377 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/join.out 2024-09-08 13:09:51.572990745 +0000 @@ -6460,7 +6460,7 @@ Aggregate -> Nested Loop -> Nested Loop - -> Index Only Scan using tenk1_unique1 on tenk1 a + -> Index Only Scan using idx_int4 on tenk1 a -> Values Scan on "*VALUES*" -> Memoize Cache Key: "*VALUES*".column1 diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/aggregates.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/aggregates.out --- /tmp/cirrus-ci-build/src/test/regress/expected/aggregates.out 2024-09-08 13:02:27.569503495 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/aggregates.out 2024-09-08 13:09:51.404989981 +0000 @@ -1106,10 +1106,29 @@ DROP AGGREGATE my_int_max(int4); DROP OPERATOR CLASS my_int_ops USING btree CASCADE; NOTICE: drop cascades to index idx_int4 +ERROR: deadlock detected +DETAIL: Process 49005 waits for AccessExclusiveLock on relation 16418 of database 16384; blocked by process 49008. +Process 49008 waits for AccessShareLock on relation 24361 of database 16384; blocked by process 49005. +HINT: See server log for query details. DROP OPERATOR FAMILY my_family USING btree; +ERROR: cannot drop operator family my_family for access method btree because other objects depend on it +DETAIL: index idx_int4 depends on operator class my_int_ops for access method btree +HINT: Use DROP ... CASCADE to drop the dependent objects too. DROP OPERATOR @>@ (int4, int4); +ERROR: cannot drop operator @>@(integer,integer) because other objects depend on it +DETAIL: operator class my_int_ops for access method btree depends on operator @>@(integer,integer) +index idx_int4 depends on operator class my_int_ops for access method btree +HINT: Use DROP ... CASCADE to drop the dependent objects too. DROP OPERATOR @<@ (int4, int4); +ERROR: cannot drop operator @<@(integer,integer) because other objects depend on it +DETAIL: operator class my_int_ops for access method btree depends on operator @<@(integer,integer) +index idx_int4 depends on operator class my_int_ops for access method btree +HINT: Use DROP ... CASCADE to drop the dependent objects too. DROP OPERATOR @=@ (int4, int4); +ERROR: cannot drop operator @=@(integer,integer) because other objects depend on it +DETAIL: operator class my_int_ops for access method btree depends on operator @=@(integer,integer) +index idx_int4 depends on operator class my_int_ops for access method btree +HINT: Use DROP ... CASCADE to drop the dependent objects too. -- But even then, the index can't be used if we order by multiple columns. explain (costs off) select max(unique1 ORDER BY unique1, tenthous) from tenk1; diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/arrays.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/arrays.out --- /tmp/cirrus-ci-build/src/test/regress/expected/arrays.out 2024-09-08 13:02:27.573485183 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/arrays.out 2024-09-08 13:09:50.060983878 +0000 @@ -2227,11 +2227,10 @@ -- array_agg(anynonarray) select array_agg(unique1) from (select unique1 from tenk1 where unique1 < 15 order by unique1) ss; - array_agg --------------------------------------- - {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14} -(1 row) - +ERROR: deadlock detected +DETAIL: Process 49011 waits for AccessShareLock on relation 24361 of database 16384; blocked by process 49005. +Process 49005 waits for AccessExclusiveLock on relation 16418 of database 16384; blocked by process 49011. +HINT: See server log for query details. select array_agg(ten) from (select ten from tenk1 where unique1 < 15 order by unique1) ss; array_agg --------------------------------- diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/psql.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/psql.out --- /tmp/cirrus-ci-build/src/test/regress/expected/psql.out 2024-09-08 13:02:27.637192195 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/psql.out 2024-09-08 13:10:07.073061895 +0000 @@ -5135,7 +5135,8 @@ AM | Operator family | Applicable types -------+-----------------+--------------------------- btree | integer_ops | smallint, integer, bigint -(1 row) + btree | my_family | integer +(2 rows) \dAo+ btree float_ops List of operators of operator families diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/select_parallel.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/select_parallel.out --- /tmp/cirrus-ci-build/src/test/regress/expected/select_parallel.out 2024-09-08 13:02:27.649137259 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/select_parallel.out 2024-09-08 13:10:12.837088443 +0000 @@ -257,13 +257,13 @@ explain (costs off) select sum(sp_parallel_restricted(unique1)) from tenk1 group by(sp_parallel_restricted(unique1)); - QUERY PLAN -------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- HashAggregate Group Key: sp_parallel_restricted(unique1) -> Gather Workers Planned: 4 - -> Parallel Index Only Scan using tenk1_unique1 on tenk1 + -> Parallel Index Only Scan using idx_int4 on tenk1 (5 rows) -- test prepared statement @@ -913,13 +913,13 @@ -- check parallelized int8 aggregate (bug #14897) explain (costs off) select avg(unique1::int8) from tenk1; - QUERY PLAN -------------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------------- Finalize Aggregate -> Gather Workers Planned: 4 -> Partial Aggregate - -> Parallel Index Only Scan using tenk1_unique1 on tenk1 + -> Parallel Index Only Scan using idx_int4 on tenk1 (5 rows) select avg(unique1::int8) from tenk1; @@ -1117,8 +1117,8 @@ explain (costs off, verbose) select count(*) from tenk1 a where (unique1, two) in (select unique1, row_number() over() from tenk1 b); - QUERY PLAN ----------------------------------------------------------------------------------------- + QUERY PLAN +------------------------------------------------------------------------------------ Aggregate Output: count(*) -> Hash Right Semi Join @@ -1128,7 +1128,7 @@ -> Gather Output: b.unique1 Workers Planned: 4 - -> Parallel Index Only Scan using tenk1_unique1 on public.tenk1 b + -> Parallel Index Only Scan using idx_int4 on public.tenk1 b Output: b.unique1 -> Hash Output: a.unique1, a.two @@ -1321,13 +1321,13 @@ EXPLAIN (COSTS OFF) SELECT 1 FROM tenk1_vw_sec WHERE (SELECT sum(f1) FROM int4_tbl WHERE f1 < unique1) < 100; - QUERY PLAN -------------------------------------------------------------------- + QUERY PLAN +-------------------------------------------------------------- Subquery Scan on tenk1_vw_sec Filter: ((SubPlan 1) < 100) -> Gather Workers Planned: 4 - -> Parallel Index Only Scan using tenk1_unique1 on tenk1 + -> Parallel Index Only Scan using idx_int4 on tenk1 SubPlan 1 -> Aggregate -> Seq Scan on int4_tbl diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/with.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/with.out --- /tmp/cirrus-ci-build/src/test/regress/expected/with.out 2024-09-08 13:02:27.669045700 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/with.out 2024-09-08 13:10:22.593014546 +0000 @@ -646,7 +646,7 @@ ------------------------------------------------------------ Aggregate CTE x - -> Index Only Scan using tenk1_unique1 on tenk1 b + -> Index Only Scan using idx_int4 on tenk1 b -> Hash Semi Join Hash Cond: (a.unique1 = x.unique1) -> Index Only Scan using tenk1_unique1 on tenk1 a diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/memoize.out /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/memoize.out --- /tmp/cirrus-ci-build/src/test/regress/expected/memoize.out 2024-09-08 13:02:27.617283754 +0000 +++ /tmp/cirrus-ci-build/src/test/recovery/tmp_check/results/memoize.out 2024-09-08 13:10:27.628978617 +0000 @@ -134,8 +134,8 @@ SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN LATERAL (SELECT t1.two+1 AS c1, t2.unique1 AS c2 FROM tenk1 t2) s ON TRUE WHERE s.c1 = s.c2 AND t1.unique1 < 1000;', false); - explain_memoize -------------------------------------------------------------------------------------------- + explain_memoize +-------------------------------------------------------------------------------------- Aggregate (actual rows=1 loops=N) -> Nested Loop (actual rows=1000 loops=N) -> Seq Scan on tenk1 t1 (actual rows=1000 loops=N) @@ -145,7 +145,7 @@ Cache Key: (t1.two + 1) Cache Mode: binary Hits: 998 Misses: 2 Evictions: Zero Overflows: 0 Memory Usage: NkB - -> Index Only Scan using tenk1_unique1 on tenk1 t2 (actual rows=1 loops=N) + -> Index Only Scan using idx_int4 on tenk1 t2 (actual rows=1 loops=N) Filter: ((t1.two + 1) = unique1) Rows Removed by Filter: 9999 Heap Fetches: N