Re: Confusing behavior of create table like - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Confusing behavior of create table like
Date
Msg-id 2465131.1596580052@sss.pgh.pa.us
Whole thread Raw
In response to Re: Confusing behavior of create table like  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 2020-08-04 19:36, Konstantin Knizhnik wrote:
>> Yes, generated columns are also using implicitly generated sequences.
>> So them are  very similar with SERIAL/BIGSERIAL columns. This actually
>> make we wonder why we can not handle them in the same way in
>> CREATE TABLE LIKE.

> The current specification of serial is a parse-time expansion of integer 
> column, sequence, and column default.

Yeah; and note it's actually defined that way in the docs.

I'd certainly concede that serial is a legacy feature now that we have
identity columns.  But, by the same token, its value is in backwards
compatibility with old behaviors.  Therefore, reimplementing it in a
way that isn't 100% backwards compatible seems like entirely the
wrong thing to do.  On similar grounds, I'd be pretty suspicious of
changing LIKE's behaviors around the case.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Jehan-Guillaume de Rorthais
Date:
Subject: Re: [patch] demote
Next
From: Peter Geoghegan
Date:
Subject: Re: Concurrency bug in amcheck