Re: sequence data type - Mailing list pgsql-hackers

From Vitaly Burovoy
Subject Re: sequence data type
Date
Msg-id CAKOSWN=rMNLQRu0nomqwdyvKwAzk5f_NksJqdbqLCNyZDaTUrA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] sequence data type  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-hackers
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?
> --
> Michael
>

Unfortunately yes, because the current patch has appeared because of
another patch with the "IDENTITY COLUMN" feature.
Since sequences used for such columns are completely hidden (they do
not appear in DEFAULTs like "serial" do) and a new option (sequence
data type) is supported with its altering (which was absent
previously), new errors appear because of that.

Be honest I did not checked the "countdown" case at the current
release, but the most important part is the second one because it is a
direct analogue of what happens (in the parallel thread) on "ALTER
TABLE tbl ALTER col TYPE new_type" where "col" is an identity column.

Since the commit 2ea5b06c7a7056dca0af1610aadebe608fbcca08 declares
"The data type determines the default minimum and maximum values of
the sequence." is it a wrong way to keep historical minimum as "1" by
default: it is not a minimum of any of supported type.

I don't think something will break if min_value is set lesser than
before, but it will decrease astonishment of users in cases I wrote in
the previous email.

-- 
Best regards,
Vitaly Burovoy



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PG_GETARG_GISTENTRY?
Next
From: Tom Lane
Date:
Subject: Re: \if, \elseif, \else, \endif (was Re: PSQL commands: \quit_if, \quit_unless)