Re: CREATE TABLE ... LIKE INCLUDING ALL does not create new sequences for serial columns

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: CREATE TABLE ... LIKE INCLUDING ALL does not create new sequences for serial columns
Дата
Msg-id eaf5d324-713f-4075-970b-989c5edea00a@eisentraut.org
обсуждение исходный текст
Ответ на CREATE TABLE ... LIKE INCLUDING ALL does not create new sequences for serial columns  (Kumaresan Balakrishnan <kumaresan.balakrishnan@intics.ai>)
Список 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 по дате отправления: