From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: nick@innsenroute.com
Subject: BUG #18645: Change between 16 and 17 when attaching partitions and the root tbl has identity col
Date: Thu, 03 Oct 2024 16:24:18 +0000
Message-ID: <18645-d2e0249ab604d4f0@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18645
Logged by: nick j
Email address: nick@innsenroute.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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, nick@innsenroute.com
Subject: Re: BUG #18645: Change between 16 and 17 when attaching partitions and the root tbl has identity col
In-Reply-To: <18645-d2e0249ab604d4f0@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox