pgsql: Fix pg_dump's logic for eliding sequence limits that match thed

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix pg_dump's logic for eliding sequence limits that match thed
Дата
Msg-id E1eoAhs-0007ZP-8F@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix pg_dump's logic for eliding sequence limits that match the defaults.

The previous coding here applied atoi() to strings that could represent
values too large to fit in an int.  If the overflowed value happened to
match one of the cases it was looking for, it would drop that limit
value from the output, leading to incorrect restoration of the sequence.

Avoid the unsafe behavior, and also make the logic cleaner by explicitly
calculating the default min/max values for the appropriate kind of
sequence.

Reported and patched by Alexey Bashtanov, though I whacked his patch
around a bit.  Back-patch to v10 where the faulty logic was added.

Discussion: https://postgr.es/m/cb85a9a5-946b-c7c4-9cf2-6cd6e25d7a33@imap.cc

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6753f6c41998a4db03a6953ab9a0a6293c18b805

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 53 ++++++++++++++++++++++++++---------------------
1 file changed, 29 insertions(+), 24 deletions(-)


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Adjust ALTER TABLE docs on partitioned constraints
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Error message improvement