Re: CREATE TABLE ... LIKE INCLUDING ALL does not create new sequences for serial columns - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: CREATE TABLE ... LIKE INCLUDING ALL does not create new sequences for serial columns
Date
Msg-id eaf5d324-713f-4075-970b-989c5edea00a@eisentraut.org
Whole thread Raw
In response to CREATE TABLE ... LIKE INCLUDING ALL does not create new sequences for serial columns  (Kumaresan Balakrishnan <kumaresan.balakrishnan@intics.ai>)
List pgsql-bugs
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.




pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19104: Does regexp_substr function support non-greedy matching?
Next
From: Tom Lane
Date:
Subject: Re: BUG #19104: Does regexp_substr function support non-greedy matching?