You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
INSERT INTO postgres_table SELECT i, i::varchar(256), '{}'::jsonb FROM generate_series(1, 10) i;
978
+
INSERT INTO reference_table SELECT i, i::varchar(256), '{}'::jsonb FROM generate_series(1, 10) i;
979
+
INSERT INTO distributed_table SELECT i, i::varchar(256), '{}'::jsonb FROM generate_series(1, 10) i;
980
+
-- Set local table join policy to auto before running the tests
981
+
SET citus.local_table_join_policy TO 'auto';
982
+
SET client_min_messages TO DEBUG1;
983
+
-- Correlated sublinks are supported in PostgreSQL 17
984
+
SELECT COUNT(*) FROM distributed_table d1 JOIN postgres_table USING (key)
985
+
WHERE d1.key IN (SELECT key FROM distributed_table WHERE d1.key = key AND key = 5);
986
+
DEBUG: Wrapping relation "postgres_table" to a subquery
987
+
DEBUG: generating subplan XXX_1 for subquery SELECT key FROM pg17.postgres_table WHERE (key OPERATOR(pg_catalog.=) 5)
988
+
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM (pg17.distributed_table d1 JOIN (SELECT postgres_table_1.key, NULL::text AS value, NULL::jsonb AS value_2 FROM (SELECT intermediate_result.key FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer)) postgres_table_1) postgres_table USING (key)) WHERE (d1.key OPERATOR(pg_catalog.=) ANY (SELECT distributed_table.key FROM pg17.distributed_table WHERE ((d1.key OPERATOR(pg_catalog.=) distributed_table.key) AND (distributed_table.key OPERATOR(pg_catalog.=) 5))))
SELECT COUNT(*) FROM distributed_table d1 JOIN postgres_table USING (key)
995
+
WHERE d1.key IN (SELECT key FROM distributed_table WHERE d1.key = key AND key = 5);
996
+
DEBUG: Wrapping relation "postgres_table" to a subquery
997
+
DEBUG: generating subplan XXX_1 for subquery SELECT key FROM pg17.postgres_table WHERE (key OPERATOR(pg_catalog.=) 5)
998
+
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM (pg17.distributed_table d1 JOIN (SELECT postgres_table_1.key, NULL::text AS value, NULL::jsonb AS value_2 FROM (SELECT intermediate_result.key FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer)) postgres_table_1) postgres_table USING (key)) WHERE (d1.key OPERATOR(pg_catalog.=) ANY (SELECT distributed_table.key FROM pg17.distributed_table WHERE ((d1.key OPERATOR(pg_catalog.=) distributed_table.key) AND (distributed_table.key OPERATOR(pg_catalog.=) 5))))
SET citus.local_table_join_policy TO 'prefer-distributed';
1005
+
SELECT COUNT(*) FROM distributed_table d1 JOIN postgres_table USING (key)
1006
+
WHERE d1.key IN (SELECT key FROM distributed_table WHERE d1.key = key AND key = 5);
1007
+
DEBUG: Wrapping relation "distributed_table" "d1" to a subquery
1008
+
DEBUG: generating subplan XXX_1 for subquery SELECT key FROM pg17.distributed_table d1 WHERE (key OPERATOR(pg_catalog.=) 5)
1009
+
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM ((SELECT d1_1.key, NULL::text AS value, NULL::jsonb AS value_2 FROM (SELECT intermediate_result.key FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer)) d1_1) d1 JOIN pg17.postgres_table USING (key)) WHERE (d1.key OPERATOR(pg_catalog.=) ANY (SELECT distributed_table.key FROM pg17.distributed_table WHERE ((d1.key OPERATOR(pg_catalog.=) distributed_table.key) AND (distributed_table.key OPERATOR(pg_catalog.=) 5))))
1010
+
ERROR: direct joins between distributed and local tables are not supported
1011
+
HINT: Use CTE's or subqueries to select from local tables and use them in joins
1012
+
RESET citus.local_table_join_policy;
1013
+
RESET client_min_messages;
1014
+
DROP TABLE reference_table;
1015
+
-- End for Correlated sublinks are now supported as of PostgreSQL 17, resolving issue #4470.
958
1016
-- Test for exclusion constraints on partitioned and distributed partitioned tables in Citus environment
INSERT INTO postgres_table SELECT i, i::varchar(256), '{}'::jsonb FROM generate_series(1, 10) i;
1137
-
INSERT INTO reference_table SELECT i, i::varchar(256), '{}'::jsonb FROM generate_series(1, 10) i;
1138
-
INSERT INTO distributed_table SELECT i, i::varchar(256), '{}'::jsonb FROM generate_series(1, 10) i;
1139
-
-- Set local table join policy to auto before running the tests
1140
-
SET citus.local_table_join_policy TO 'auto';
1141
-
SET client_min_messages TO DEBUG1;
1142
-
-- Correlated sublinks are supported in PostgreSQL 17
1143
-
SELECT COUNT(*) FROM distributed_table d1 JOIN postgres_table USING (key)
1144
-
WHERE d1.key IN (SELECT key FROM distributed_table WHERE d1.key = key AND key = 5);
1145
-
DEBUG: Wrapping relation "postgres_table" to a subquery
1146
-
DEBUG: generating subplan XXX_1 for subquery SELECT key FROM pg17.postgres_table WHERE (key OPERATOR(pg_catalog.=) 5)
1147
-
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM (pg17.distributed_table d1 JOIN (SELECT postgres_table_1.key, NULL::text AS value, NULL::jsonb AS value_2 FROM (SELECT intermediate_result.key FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer)) postgres_table_1) postgres_table USING (key)) WHERE (d1.key OPERATOR(pg_catalog.=) ANY (SELECT distributed_table.key FROM pg17.distributed_table WHERE ((d1.key OPERATOR(pg_catalog.=) distributed_table.key) AND (distributed_table.key OPERATOR(pg_catalog.=) 5))))
SELECT COUNT(*) FROM distributed_table d1 JOIN postgres_table USING (key)
1154
-
WHERE d1.key IN (SELECT key FROM distributed_table WHERE d1.key = key AND key = 5);
1155
-
DEBUG: Wrapping relation "postgres_table" to a subquery
1156
-
DEBUG: generating subplan XXX_1 for subquery SELECT key FROM pg17.postgres_table WHERE (key OPERATOR(pg_catalog.=) 5)
1157
-
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM (pg17.distributed_table d1 JOIN (SELECT postgres_table_1.key, NULL::text AS value, NULL::jsonb AS value_2 FROM (SELECT intermediate_result.key FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer)) postgres_table_1) postgres_table USING (key)) WHERE (d1.key OPERATOR(pg_catalog.=) ANY (SELECT distributed_table.key FROM pg17.distributed_table WHERE ((d1.key OPERATOR(pg_catalog.=) distributed_table.key) AND (distributed_table.key OPERATOR(pg_catalog.=) 5))))
SET citus.local_table_join_policy TO 'prefer-distributed';
1164
-
SELECT COUNT(*) FROM distributed_table d1 JOIN postgres_table USING (key)
1165
-
WHERE d1.key IN (SELECT key FROM distributed_table WHERE d1.key = key AND key = 5);
1166
-
DEBUG: Wrapping relation "distributed_table" "d1" to a subquery
1167
-
DEBUG: generating subplan XXX_1 for subquery SELECT key FROM pg17.distributed_table d1 WHERE (key OPERATOR(pg_catalog.=) 5)
1168
-
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM ((SELECT d1_1.key, NULL::text AS value, NULL::jsonb AS value_2 FROM (SELECT intermediate_result.key FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(key integer)) d1_1) d1 JOIN pg17.postgres_table USING (key)) WHERE (d1.key OPERATOR(pg_catalog.=) ANY (SELECT distributed_table.key FROM pg17.distributed_table WHERE ((d1.key OPERATOR(pg_catalog.=) distributed_table.key) AND (distributed_table.key OPERATOR(pg_catalog.=) 5))))
1169
-
ERROR: direct joins between distributed and local tables are not supported
1170
-
HINT: Use CTE's or subqueries to select from local tables and use them in joins
1171
-
RESET citus.local_table_join_policy;
1172
-
RESET client_min_messages;
1173
-
DROP TABLE reference_table;
1174
-
-- End for Correlated sublinks are now supported as of PostgreSQL 17, resolving issue #4470.
1175
1120
DROP SCHEMA pg17 CASCADE;
1176
1121
NOTICE: drop cascades to 5 other objects
1177
1122
DETAIL: drop cascades to function fake_am_handler(internal)
0 commit comments