Re: [HACKERS] Off-by-one oddity in minval for decreasing sequences

2017-01-20 Thread Michael Paquier
On Sat, Jan 21, 2017 at 10:20 AM, Peter Eisentraut wrote: > On 1/6/17 2:15 PM, Daniel Verite wrote: >> I notice that there's a preexisting >> oddity in the fact that sequences created with a negative increment >> in current releases initialize the minval to -(2^63)+1 instead of -2^63, >> the actua

Re: [HACKERS] Off-by-one oddity in minval for decreasing sequences

2017-01-20 Thread Peter Eisentraut
On 1/6/17 2:15 PM, Daniel Verite wrote: > I notice that there's a preexisting > oddity in the fact that sequences created with a negative increment > in current releases initialize the minval to -(2^63)+1 instead of -2^63, > the actual lowest value for a bigint. I think that had to do with that we

Re: [HACKERS] Off-by-one oddity in minval for decreasing sequences

2017-01-13 Thread Michael Paquier
On Sat, Jan 7, 2017 at 4:15 AM, Daniel Verite wrote: > The defaults comes from these definitions, in include/pg_config_manual.h > > /* > * Set the upper and lower bounds of sequence values. > */ > #define SEQ_MAXVALUEPG_INT64_MAX > #define SEQ_MINVALUE(-SEQ_MAXVALUE) > > with no comment

Re: [HACKERS] Off-by-one oddity in minval for decreasing sequences

2017-01-12 Thread Andrew Dunstan
On 01/12/2017 03:12 PM, Jim Nasby wrote: On 1/10/17 8:07 AM, Robert Haas wrote: This seems like a sensible argument to me, but maybe somebody's got a contrary viewpoint? I suspect the number of users that use negative sequence values is so small that this is unlikely to be noticed. I can't

Re: [HACKERS] Off-by-one oddity in minval for decreasing sequences

2017-01-12 Thread Jim Nasby
On 1/10/17 8:07 AM, Robert Haas wrote: This seems like a sensible argument to me, but maybe somebody's got a contrary viewpoint? I suspect the number of users that use negative sequence values is so small that this is unlikely to be noticed. I can't think of any risk to "closing the hole" tha

Re: [HACKERS] Off-by-one oddity in minval for decreasing sequences

2017-01-10 Thread Robert Haas
On Fri, Jan 6, 2017 at 2:15 PM, Daniel Verite wrote: > When testing the patch at https://commitfest.postgresql.org/12/768/ > ("sequence data type" by Peter E.), I notice that there's a preexisting > oddity in the fact that sequences created with a negative increment > in current releases initializ

[HACKERS] Off-by-one oddity in minval for decreasing sequences

2017-01-06 Thread Daniel Verite
Hi, When testing the patch at https://commitfest.postgresql.org/12/768/ ("sequence data type" by Peter E.), I notice that there's a preexisting oddity in the fact that sequences created with a negative increment in current releases initialize the minval to -(2^63)+1 instead of -2^63, the actual l