Re: Identity columns should own only one sequence

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Identity columns should own only one sequence
Дата
Msg-id 20190427004936.GE2032@paquier.xyz
обсуждение исходный текст
Ответ на Re: Identity columns should own only one sequence  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On Fri, Apr 26, 2019 at 11:55:34AM -0400, Alvaro Herrera wrote:
> On 2019-Apr-26, Laurenz Albe wrote:
> I think a better overall fix is that that when creating the generated
> column (or altering a column to make it generated) we should look for
> existing an existing sequence and take ownership of that (update
> pg_depend records), before deciding to create a new sequence.

What that be actually right?  The current value of the sequence would
be the one from the previous use, and max/min values may not be the
defaults associated with identity columns, which is ranged in
[-2^31,2^31-1] by default, but the sequence you may attempt (or not)
to attach to could have completely different properties.  It seems to
me that it is much better to start afresh and not enforce the sequence
into something that the user may perhaps not want to use.

My 2c.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: clean up docs for v12
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Calling PrepareTempTablespaces in BufFileCreateTemp