BUG #18645: Change between 16 and 17 when attaching partitions and the root tbl has identity col

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: nick(at)innsenroute(dot)com
Subject: BUG #18645: Change between 16 and 17 when attaching partitions and the root tbl has identity col
Date: 2024-10-03 16:24:18
Message-ID: 18645-d2e0249ab604d4f0@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: 18645
Logged by: nick j
Email address: nick(at)innsenroute(dot)com
PostgreSQL version: 17.0
Operating system: win11
Description:

In v16, the following succeeded:

CREATE TABLE IF NOT EXISTS public.foo
(
device_key uuid NOT NULL,
message_created_date_time timestamp with time zone NOT NULL DEFAULT
CURRENT_TIMESTAMP,
message_id bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1
START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 )
) PARTITION BY LIST (device_key);

create table foo_1 (like foo including all);
alter table foo attach partition foo_1 for values in
('A1BBF163-6375-4C3D-8846-CDFABCBA7580');

create table foo_2 (like foo including all);
alter table foo attach partition foo_2 for values in
('B1BBF163-6375-4C3D-8846-CDFABCBA7580');

In v17, this throws the following exception:

ERROR: The new partition may not contain an identity column.table "foo_1"
being attached contains an identity column "message_id"

Switching to: create table foo_2 (like foo including all excluding
identity); works.

This first surfaced when attempting to upgrade a v16 cluster to v17 via
pg_upgrade.

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-10-03 16:51:34 Re: BUG #18637: CREATE INDEX won't look up operator classes in search_path if PARTITION BY is specified
Previous Message Dean Rasheed 2024-10-03 13:17:24 Re: BUG #18634: Wrong varnullingrels with merge ... when not matched by source