pg_dump sometimes misses sequence parameters

Поиск
Список
Период
Сортировка
От Alexey Bashtanov
Тема pg_dump sometimes misses sequence parameters
Дата
Msg-id cb85a9a5-946b-c7c4-9cf2-6cd6e25d7a33@imap.cc
обсуждение исходный текст
Ответы Re: pg_dump sometimes misses sequence parameters
Список pgsql-bugs
The bug affects REL_10_STABLE and master branches.
9.4..9.6 are unaffected.

To reproduce:
psql -c 'DROP SEQUENCE IF EXISTS foo'
psql -c 'CREATE SEQUENCE foo INCREMENT BY -1 MINVALUE 
-9223372036854775808 MAXVALUE 9223372036854775807'
pg_dump -t foo > tmp
psql -c 'DROP SEQUENCE foo'
psql <tmp

The last psql call fails with "START value (9223372036854775807) cannot 
be greater than MAXVALUE (-1)",
as pg_dump does not record MAXVALUE properly.

The reason is atoi is used and those large numbers are interpreted as 0 
and -1 respectively.
I'd propose to use atol instead of atoi, please see the patch attached.

Best,
   Alexey

Вложения

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

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: BUG #15074: psql client never returns when creating index (long running operation)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump sometimes misses sequence parameters