Re: Confusing behavior of create table like

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Confusing behavior of create table like
Date: 2020-08-04 21:50:38
Message-ID: b5ba96dc-a305-7bb8-3580-0ac8fe53f1a1@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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. The behavior of column defaults
in CREATE TABLE LIKE does not currently include rewriting the default
expression or creating additional schema objects. If you want to
introduce these concepts, it should be done in a general way, not just
hard-coded for a particular case.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-08-04 22:00:34 Re: 13dev failed assert: comparetup_index_btree(): ItemPointer values should never be equal
Previous Message Peter Geoghegan 2020-08-04 21:49:54 Re: 13dev failed assert: comparetup_index_btree(): ItemPointer values should never be equal