Re: Confusing behavior of create table like
От | Konstantin Knizhnik |
---|---|
Тема | Re: Confusing behavior of create table like |
Дата | |
Msg-id | 7f80abcf-ff62-3ca2-92f8-bc46035f545f@postgrespro.ru обсуждение исходный текст |
Ответ на | Re: Confusing behavior of create table like (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>) |
Ответы |
Re: Confusing behavior of create table like
Re: Confusing behavior of create table like |
Список | 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 по дате отправления: