Обсуждение: PG 14 range partitions creation works but subsequently can't be found correctly

Поиск
Список
Период
Сортировка

PG 14 range partitions creation works but subsequently can't be found correctly

От
"Ian R. Campbell"
Дата:
Server: v14.1-1 x64 Windows

The following executes without problem:

CREATE TABLE part (
    h "char" not null,
    val int4 not null
) PARTITION BY RANGE (h);

create table part_00 partition of part FOR VALUES FROM ((-128)::"char") to ((-113)::"char");
create table part_01 partition of part FOR VALUES FROM ((-112)::"char") to ((-97)::"char");
create table part_02 partition of part FOR VALUES FROM ((-96)::"char") to ((-81)::"char");
create table part_03 partition of part FOR VALUES FROM ((-80)::"char") to ((-65)::"char");
create table part_04 partition of part FOR VALUES FROM ((-64)::"char") to ((-49)::"char");
create table part_05 partition of part FOR VALUES FROM ((-48)::"char") to ((-33)::"char");
create table part_06 partition of part FOR VALUES FROM ((-32)::"char") to ((-17)::"char");
create table part_07 partition of part FOR VALUES FROM ((-16)::"char") to ((-1)::"char");
create table part_08 partition of part FOR VALUES FROM (0::"char") to (15::"char");
create table part_09 partition of part FOR VALUES FROM (16::"char") to (31::"char");
create table part_10 partition of part FOR VALUES FROM (32::"char") to (47::"char");
create table part_11 partition of part FOR VALUES FROM (48::"char") to (63::"char");
create table part_12 partition of part FOR VALUES FROM (64::"char") to (79::"char");
create table part_13 partition of part FOR VALUES FROM (80::"char") to (95::"char");
create table part_14 partition of part FOR VALUES FROM (96::"char") to (111::"char");
create table part_15 partition of part FOR VALUES FROM (112::"char") to (127::"char");

In pgAdmin 4, navigating to "Partitions" (after refreshing) results only in a spinning wheel.

Any attempt to insert into this table fails with "no partition of relation "part" found for row".

The following does work (result 0):

select count(1) from part_00;

Rebooting the server doesn't help.

Ian Campbell

Re: PG 14 range partitions creation works but subsequently can't be found correctly

От
Tom Lane
Дата:
"Ian R. Campbell" <ian.campbell@thepathcentral.com> writes:
> The following executes without problem:

> CREATE TABLE part (
>     h "char" not null,
>     val int4 not null
> ) PARTITION BY RANGE (h);

> create table part_00 partition of part FOR VALUES FROM ((-128)::"char") to
> ((-113)::"char");
> create table part_01 partition of part FOR VALUES FROM ((-112)::"char") to
> ((-97)::"char");
> ...

This works for me in psql, modulo the fact that your boundary conditions
are off-by-one.  (That is, I can store h = -114 and -112, but not -113,
in this table.)

> In pgAdmin 4, navigating to "Partitions" (after refreshing) results only in
> a spinning wheel.

That sounds like a pgAdmin bug --- but this list is not the place
to report pgAdmin problems.

            regards, tom lane