BUG #16302: too many range table entries - when count partition table(65538 childs)

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: digoal(at)126(dot)com
Subject: BUG #16302: too many range table entries - when count partition table(65538 childs)
Date: 2020-03-14 14:02:19
Message-ID: 16302-e45634e2c0e34e97@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16302
Logged by: Zhou Digoal
Email address: digoal(at)126(dot)com
PostgreSQL version: 12.2
Operating system: CentOS 7.7 x64
Description:

hi,
when i count a partition table with many childs , it's error below:

```
postgres=> select count(*) from p;
ERROR: 54000: too many range table entries
LOCATION: add_rte_to_flat_rtable, setrefs.c:425
```

regenerate:

```
do language plpgsql $$
declare
begin
drop table if exists p;
create table p (id int , info text, crt_time timestamp) partition by range
(crt_time);
create table p2020 partition of p FOR VALUES FROM ('2020-01-01') TO
('2021-01-01') partition by hash (id);
create table p2021 partition of p FOR VALUES FROM ('2021-01-01') TO
('2022-01-01') partition by hash (id);
for i in 0..30000 loop
execute format ('create table p2020_%s partition of p2020 FOR VALUES WITH
(MODULUS 65537, REMAINDER %s)', i, i);
execute format('alter table p2020_%s set (parallel_workers=52)',i);
end loop;
end;
$$;

do language plpgsql $$
declare
begin
for i in 30001..60000 loop
execute format ('create table p2020_%s partition of p2020 FOR VALUES WITH
(MODULUS 65537, REMAINDER %s)', i, i);
execute format('alter table p2020_%s set (parallel_workers=52)',i);
end loop;
end;
$$;

do language plpgsql $$
declare
begin
for i in 60001..65536 loop
execute format ('create table p2020_%s partition of p2020 FOR VALUES WITH
(MODULUS 65537, REMAINDER %s)', i, i);
execute format('alter table p2020_%s set (parallel_workers=52)',i);
end loop;
end;
$$;
```

best regards,
digoal

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2020-03-14 15:03:05 Re: BUG #16302: too many range table entries - when count partition table(65538 childs)
Previous Message David G. Johnston 2020-03-14 04:15:05 Re: BUG #16301: unable to connect to server