citus icon indicating copy to clipboard operation
citus copied to clipboard

PG18 - ERROR: could not open relation with OID 0

Open m3hm3t opened this issue 6 months ago • 0 comments

Reproduce

SET citus.next_shard_id TO 1640000;
CREATE SCHEMA ch_bench_having;
SET search_path = ch_bench_having, public;

CREATE TABLE stock (
  s_w_id       int NOT NULL,
  s_i_id       int NOT NULL,
  s_order_cnt  int NOT NULL);
SELECT create_distributed_table('stock','s_w_id');

INSERT INTO stock SELECT c, c, c FROM generate_series(1, 5) AS c;

-- the query that used to crash:
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 FROM stock)
ORDER BY s_i_id;

m3hm3t avatar Jun 16 '25 19:06 m3hm3t