From: Peter Eisentraut <peter@eisentraut.org>
To: Kumaresan Balakrishnan <kumaresan.balakrishnan@intics.ai>
To: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Cc: Janarthanan Poornavel <jana@intics.ai>
Cc: Sivadhas arumugam <sivadhas.arumugam@intics.ai>
Cc: Intics Devops <intics.devops@intics.ai>
Subject: Re: CREATE TABLE ... LIKE INCLUDING ALL does not create new sequences for serial columns
Date: Wed, 5 Nov 2025 14:01:16 +0100
Message-ID: <eaf5d324-713f-4075-970b-989c5edea00a@eisentraut.org> (raw)
In-Reply-To: <PN1PPF4D94C7838D296E7117862D95C7F5985C7A@PN1PPF4D94C7838.INDPRD01.PROD.OUTLOOK.COM>
References: <PN1PPF4D94C7838D296E7117862D95C7F5985C7A@PN1PPF4D94C7838.INDPRD01.PROD.OUTLOOK.COM>
On 03.11.25 18:10, Kumaresan Balakrishnan wrote:
> This behavior occurs even with `INCLUDING ALL`, which implies `INCLUDING
> DEFAULTS`
> and `INCLUDING IDENTITY`. However, it seems that when serial columns
> are used,
> their associated sequences are copied by reference rather than duplicated.
This works correctly if you use GENERATED ALWAYS AS IDENTITY instead of
serial.
Using serial is kind of deprecated for reasons like this.
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: peter@eisentraut.org, kumaresan.balakrishnan@intics.ai, pgsql-bugs@lists.postgresql.org, jana@intics.ai, sivadhas.arumugam@intics.ai, intics.devops@intics.ai
Subject: Re: CREATE TABLE ... LIKE INCLUDING ALL does not create new sequences for serial columns
In-Reply-To: <eaf5d324-713f-4075-970b-989c5edea00a@eisentraut.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