Re: Confusing behavior of create table like

2020-08-04 Thread Tom Lane
Peter Eisentraut 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 TA

Re: Confusing behavior of create table like

2020-08-04 Thread Peter Eisentraut
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

Re: Confusing behavior of create table like

2020-08-04 Thread Konstantin Knizhnik
On 04.08.2020 19:53, Robert Haas wrote: On Mon, Aug 3, 2020 at 12:35 PM Peter Eisentraut wrote: On 2020-08-03 14:58, Konstantin Knizhnik wrote: May be generated and identity columns are good things. I have nothing against them. But what preventing us from providing the similar behavior for

Re: Confusing behavior of create table like

2020-08-04 Thread Robert Haas
On Mon, Aug 3, 2020 at 12:35 PM Peter Eisentraut wrote: > On 2020-08-03 14:58, Konstantin Knizhnik wrote: > > 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? > > I

Re: Confusing behavior of create table like

2020-08-03 Thread Peter Eisentraut
On 2020-08-03 14:58, Konstantin Knizhnik wrote: 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? In my mind, serial/bigserial is deprecated and it's not worth spending effo

Re: Confusing behavior of create table like

2020-08-03 Thread Robert Haas
On Mon, Aug 3, 2020 at 8:59 AM Konstantin Knizhnik wrote: > 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? Backward compatibility seems like one good argument. It kin

Re: Confusing behavior of create table like

2020-08-03 Thread Konstantin Knizhnik
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 T

Re: Confusing behavior of create table like

2020-08-03 Thread Peter Eisentraut
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 wh