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

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [HACKERS] Off-by-one oddity in minval for decreasing sequences
Дата
Msg-id d1b72ff9-e9ef-818b-4295-ba6d9a38422e@2ndquadrant.com
обсуждение исходный текст
Ответы Re: [HACKERS] Off-by-one oddity in minval for decreasing sequences  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
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 had to play games to work around the
lack of proper int64 support, and various weird code has developed over
time because of that.  I think we should fix it if we can.

The attached patch fixes the default minimum value to use the proper
int64 min value.

With this patch, when upgrading with pg_dump, descending sequences with
the previous default minimum value would be kept with that
now-not-default value.  We could alternative adjust those sequences to
the new default value.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: [HACKERS] remote_apply for logical replication?
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: [HACKERS] Measuring replay lag