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

From Konstantin Knizhnik
Subject Re: Confusing behavior of create table like
Date
Msg-id 7f80abcf-ff62-3ca2-92f8-bc46035f545f@postgrespro.ru
Whole thread Raw
In response to Re: Confusing behavior of create table like  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: Confusing behavior of create table like  (Robert Haas <robertmhaas@gmail.com>)
Re: Confusing behavior of create table like  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers

On 03.08.2020 11:00, Peter Eisentraut wrote:
> On 2020-08-01 00:06, Konstantin Knizhnik wrote:
>> Postgres provides serial and bigserial column types for which it
>> implicitly creates sequence.
>> As far as this mechanism is somehow hidden from user, it may be
>> confusing that table
>> created with CREATE TABLE LIKE has no associated sequence.
>
> That's why identity columns were added.  You shouldn't use serial 
> columns anymore, especially if you are concerned about behaviors like 
> this.
>
I can completely agree with this position.
There are several things in Postgres which are conceptually similar, 
share a lot of code but... following different rules.
Usually it happens when some new notion is introduced, fully or partly 
substitute old notion.
Inheritance and declarative partitioning is one of such examples.
Although them are used to solve the same goal, there are many cases when 
some optimization works for partitioned table but not for inheritance.

May be generated and identity columns are good things. I have nothing 
against them.
But what preventing us from providing the similar behavior for 
serial/bigseries types?




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Add section headings to index types doc
Next
From: Robert Haas
Date:
Subject: Re: recovering from "found xmin ... from before relfrozenxid ..."