Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/distributed/deparser/ruleutils_18.c
Original file line number Diff line number Diff line change
Expand Up @@ -10356,4 +10356,4 @@ get_insert_column_names_list(List *targetList, StringInfo buf,

return strippedexprs;
}
#endif /* (PG_VERSION_NUM >= PG_VERSION_17) && (PG_VERSION_NUM < PG_VERSION_18) */
#endif /* (PG_VERSION_NUM >= PG_VERSION_18) && (PG_VERSION_NUM < PG_VERSION_19) */
5 changes: 2 additions & 3 deletions src/test/regress/citus_tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,8 @@ def _run_pg_regress(
output_dir,
"--use-existing",
]
if PG_MAJOR_VERSION >= 16:
command.append("--expecteddir")
command.append(output_dir)
command.append("--expecteddir")
command.append(output_dir)
if extra_tests != "":
command.append(extra_tests)

Expand Down
13 changes: 13 additions & 0 deletions src/test/regress/citus_tests/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def extra_tests(self):
"multi_modifying_xacts": TestDeps("minimal_schedule"),
"multi_mx_modifying_xacts": TestDeps(None, ["multi_mx_create_table"]),
"multi_mx_router_planner": TestDeps(None, ["multi_mx_create_table"]),
"ch_bench_having_mx": TestDeps(None, ["multi_mx_copy_data"]),
"multi_mx_copy_data": TestDeps(None, ["multi_mx_create_table"]),
"multi_mx_modifications": TestDeps(None, ["multi_mx_create_table"]),
"multi_mx_schema_support": TestDeps(None, ["multi_mx_copy_data"]),
Expand Down Expand Up @@ -268,6 +269,18 @@ def extra_tests(self):
repeatable=False,
),
"pg17": TestDeps("minimal_schedule", ["multi_behavioral_analytics_create_table"]),
# pg17_json shares a schedule line with pg17, so it needs pg17's deps too.
"pg17_json": TestDeps(
"minimal_schedule", ["multi_behavioral_analytics_create_table"]
),
# ch_bench_having and having_subquery share their schedule lines with tests
# that query lineitem and the tpch tables, and ch_bench_having itself needs
# public.supplier/nation; base_schedule creates and loads all of them.
"ch_bench_having": TestDeps("base_schedule"),
"having_subquery": TestDeps("base_schedule"),
# multi_subquery shares its schedule line with cross_join, and neither drops
# the tables it creates, so the line cannot be run more than once.
"multi_subquery": TestDeps("base_schedule", repeatable=False),
"multi_subquery_misc": TestDeps(
"minimal_schedule", ["multi_behavioral_analytics_create_table"]
),
Expand Down
10 changes: 0 additions & 10 deletions src/test/regress/expected/ch_bench_having.out
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ SELECT create_distributed_table('stock','s_w_id');

(1 row)

SELECT public.explain_with_pg17_initplan_format($Q$
explain (costs false, summary false, timing false)
select s_i_id, sum(s_order_cnt) as ordercount
from stock
where s_order_cnt > (select sum(s_order_cnt) * .005 as where_query from stock)
group by s_i_id
having sum(s_order_cnt) > (select max(s_order_cnt) - 3 as having_query from stock)
order by s_i_id;
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
Sort
Expand Down Expand Up @@ -61,14 +59,12 @@ $Q$) as "QUERY PLAN";
Filter: ((s_order_cnt)::numeric > (InitPlan 1).col1)
(36 rows)

SELECT public.explain_with_pg17_initplan_format($Q$
explain (costs false, summary false, timing false)
select s_i_id, sum(s_order_cnt) as ordercount
from stock
group by s_i_id
having sum(s_order_cnt) > (select max(s_order_cnt) - 3 as having_query from stock)
order by s_i_id;
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
Sort
Expand Down Expand Up @@ -97,13 +93,11 @@ $Q$) as "QUERY PLAN";
-> Seq Scan on stock_1640000 stock
(24 rows)

SELECT public.explain_with_pg17_initplan_format($Q$
explain (costs false, summary false, timing false)
select s_i_id, sum(s_order_cnt) as ordercount
from stock
group by s_i_id
having sum(s_order_cnt) > (select max(s_order_cnt) - 3 as having_query from stock);
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
HashAggregate
Expand All @@ -130,14 +124,12 @@ $Q$) as "QUERY PLAN";
-> Seq Scan on stock_1640000 stock
(22 rows)

SELECT public.explain_with_pg17_initplan_format($Q$
explain (costs false)
select s_i_id, sum(s_order_cnt) as ordercount
from stock s
group by s_i_id
having (select true)
order by s_i_id;
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
Sort
Expand All @@ -159,13 +151,11 @@ $Q$) as "QUERY PLAN";
-> Seq Scan on stock_1640000 s
(17 rows)

SELECT public.explain_with_pg17_initplan_format($Q$
explain (costs false)
select s_i_id, sum(s_order_cnt) as ordercount
from stock s
group by s_i_id
having (select true);
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
HashAggregate
Expand Down
10 changes: 0 additions & 10 deletions src/test/regress/expected/ch_bench_having_mx.out
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ SELECT create_distributed_table('stock','s_w_id');

\c - - - :worker_1_port
SET search_path = ch_bench_having;
SELECT public.explain_with_pg17_initplan_format($Q$
explain (costs false, summary false, timing false)
select s_i_id, sum(s_order_cnt) as ordercount
from stock
where s_order_cnt > (select sum(s_order_cnt) * .005 as where_query from stock)
group by s_i_id
having sum(s_order_cnt) > (select max(s_order_cnt) - 3 as having_query from stock)
order by s_i_id;
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
Sort
Expand Down Expand Up @@ -65,14 +63,12 @@ $Q$) as "QUERY PLAN";
Filter: ((s_order_cnt)::numeric > (InitPlan 1).col1)
(36 rows)

SELECT public.explain_with_pg17_initplan_format($Q$
explain (costs false, summary false, timing false)
select s_i_id, sum(s_order_cnt) as ordercount
from stock
group by s_i_id
having sum(s_order_cnt) > (select max(s_order_cnt) - 3 as having_query from stock)
order by s_i_id;
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
Sort
Expand Down Expand Up @@ -101,13 +97,11 @@ $Q$) as "QUERY PLAN";
-> Seq Scan on stock_1640000 stock
(24 rows)

SELECT public.explain_with_pg17_initplan_format($Q$
explain (costs false, summary false, timing false)
select s_i_id, sum(s_order_cnt) as ordercount
from stock
group by s_i_id
having sum(s_order_cnt) > (select max(s_order_cnt) - 3 as having_query from stock);
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
HashAggregate
Expand All @@ -134,14 +128,12 @@ $Q$) as "QUERY PLAN";
-> Seq Scan on stock_1640000 stock
(22 rows)

SELECT public.explain_with_pg17_initplan_format($Q$
explain (costs false)
select s_i_id, sum(s_order_cnt) as ordercount
from stock s
group by s_i_id
having (select true)
order by s_i_id;
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
Sort
Expand All @@ -163,12 +155,10 @@ $Q$) as "QUERY PLAN";
-> Seq Scan on stock_1640000 s
(17 rows)

SELECT public.explain_with_pg17_initplan_format($Q$
explain select s_i_id, sum(s_order_cnt) as ordercount
from stock s
group by s_i_id
having (select true);
$Q$) as "QUERY PLAN";
QUERY PLAN
---------------------------------------------------------------------
HashAggregate (cost=500.01..503.01 rows=200 width=12)
Expand Down
10 changes: 2 additions & 8 deletions src/test/regress/expected/columnar_chunk_filtering.out
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,6 @@ DETAIL: unparameterized; 1 clauses pushed down

SET hash_mem_multiplier = 1.0;
\pset footer off
SELECT columnar_test_helpers.explain_with_pg16_subplan_format($Q$
EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF)
SELECT sum(a) FROM pushdown_test where
(
Expand All @@ -993,23 +992,18 @@ SELECT sum(a) FROM pushdown_test where
)
or
(a > 200000-2010);
$Q$) as "QUERY PLAN";
NOTICE: columnar planner: adding CustomScan path for pushdown_test
DETAIL: unparameterized; 0 clauses pushed down
CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_format(text) line XX at FOR over EXECUTE statement
NOTICE: columnar planner: cannot push down clause: must match 'Var <op> Expr' or 'Expr <op> Var'
HINT: Var must only reference this rel, and Expr must not reference this rel
CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_format(text) line XX at FOR over EXECUTE statement
NOTICE: columnar planner: cannot push down clause: must not contain a subplan
CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_format(text) line XX at FOR over EXECUTE statement
NOTICE: columnar planner: adding CustomScan path for pushdown_test
DETAIL: unparameterized; 1 clauses pushed down
CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_format(text) line XX at FOR over EXECUTE statement
QUERY PLAN
QUERY PLAN
---------------------------------------------------------------------
Aggregate (actual rows=1 loops=1)
-> Custom Scan (ColumnarScan) on pushdown_test (actual rows=3009 loops=1)
Filter: ((((a)::double precision > random()) AND (((a < 200) AND (NOT (SubPlan 1))) OR ((a > 1000) AND (a < 2000)))) OR (a > 197990))
Filter: ((((a)::double precision > random()) AND (((a < 200) AND (NOT (ANY (a = (SubPlan 1).col1)))) OR ((a > 1000) AND (a < 2000)))) OR (a > 197990))
Rows Removed by Filter: 1991
Columnar Projected Columns: a
Columnar Chunk Group Filters: (((a < 200) OR ((a > 1000) AND (a < 2000))) OR (a > 197990))
Expand Down
10 changes: 2 additions & 8 deletions src/test/regress/expected/columnar_chunk_filtering_0.out
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,6 @@ DETAIL: unparameterized; 1 clauses pushed down

SET hash_mem_multiplier = 1.0;
\pset footer off
SELECT columnar_test_helpers.explain_with_pg16_subplan_format($Q$
EXPLAIN (analyze on, costs off, timing off, summary off, BUFFERS OFF)
SELECT sum(a) FROM pushdown_test where
(
Expand All @@ -993,23 +992,18 @@ SELECT sum(a) FROM pushdown_test where
)
or
(a > 200000-2010);
$Q$) as "QUERY PLAN";
NOTICE: columnar planner: adding CustomScan path for pushdown_test
DETAIL: unparameterized; 0 clauses pushed down
CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_format(text) line XX at FOR over EXECUTE statement
NOTICE: columnar planner: cannot push down clause: must match 'Var <op> Expr' or 'Expr <op> Var'
HINT: Var must only reference this rel, and Expr must not reference this rel
CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_format(text) line XX at FOR over EXECUTE statement
NOTICE: columnar planner: cannot push down clause: must not contain a subplan
CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_format(text) line XX at FOR over EXECUTE statement
NOTICE: columnar planner: adding CustomScan path for pushdown_test
DETAIL: unparameterized; 1 clauses pushed down
CONTEXT: PL/pgSQL function columnar_test_helpers.explain_with_pg16_subplan_format(text) line XX at FOR over EXECUTE statement
QUERY PLAN
QUERY PLAN
---------------------------------------------------------------------
Aggregate (actual rows=1 loops=1)
-> Custom Scan (ColumnarScan) on pushdown_test (actual rows=3009 loops=1)
Filter: ((((a)::double precision > random()) AND (((a < 200) AND (NOT (SubPlan 1))) OR ((a > 1000) AND (a < 2000)))) OR (a > 197990))
Filter: ((((a)::double precision > random()) AND (((a < 200) AND (NOT (ANY (a = (SubPlan 1).col1)))) OR ((a > 1000) AND (a < 2000)))) OR (a > 197990))
Rows Removed by Filter: 1991
Columnar Projected Columns: a
Columnar Chunk Group Filters: (((a < 200) OR ((a > 1000) AND (a < 2000))) OR (a > 197990))
Expand Down
5 changes: 0 additions & 5 deletions src/test/regress/expected/columnar_paths.out
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
CREATE SCHEMA columnar_paths;
SET search_path TO columnar_paths;
-- columnar_paths has an alternative test output file because PG17 improved
-- the optimizer's ability to use statistics to estimate the size of a CTE
-- scan.
-- The relevant PG commit is:
-- https://github.com/postgres/postgres/commit/f7816aec23eed1dc1da5f9a53cb6507d30b7f0a2
CREATE TABLE full_correlated (a int, b text, c int, d int) USING columnar;
INSERT INTO full_correlated SELECT i, i::text FROM generate_series(1, 1000000) i;
CREATE INDEX full_correlated_btree ON full_correlated (a);
Expand Down
Loading
Loading