Re: sequence data type

Поиск
Список
Период
Сортировка
От Vitaly Burovoy
Тема Re: sequence data type
Дата
Msg-id CAKOSWNn9WN7cceZTPiLY0cYg+VmGSG5oevs4VHHAp+H=VZJ1oA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] sequence data type  ("Daniel Verite" <daniel@manitou-mail.org>)
Ответы Re: sequence data type  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
On 3/30/17, Vitaly Burovoy <vitaly.burovoy@gmail.com> wrote:
> On 3/29/17, Vitaly Burovoy <vitaly.burovoy@gmail.com> wrote:
>> On 3/29/17, Michael Paquier <michael.paquier@gmail.com> wrote:
>>> On Thu, Mar 30, 2017 at 11:18 AM, Vitaly Burovoy
>>> <vitaly.burovoy@gmail.com> wrote:
>>>> I think min_value and max_value should not be set to "1" or "-1" but
>>>> to real min/max of the type by default.
>>>
>>> This is the default behavior for ages, since e8647c45 to be exact. So
>>> you would change 20 years of history?
>>
>> ... is it a wrong way to keep historical minimum as "1" by
>> default: it is not a minimum of any of supported type.
>
> I've read the standard about "minvalue", "maxvalue" and "start".
> OK, I was wrong. Since "start" should be equal to "minvalue" unless
> defined explicitly, the only bug left from my first email here is
> resetting "minvalue" back to 1 when data type changes and if the value
> matches the bound of the old type (the last case there).
>
> P.S.: the same thing with "maxvalue" when "increment" is negative.

It seemed not very hard to fix it.
Please find attached patch to be applied on top of your one.

I've added more tests to cover different cases of changing bounds when
data type is changed.

-- 
Best regards,
Vitaly Burovoy

Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [POC] A better way to expand hash indexes.
Следующее
От: Vitaly Burovoy
Дата:
Сообщение: Re: identity columns