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.