pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix pg_dump's logic for eliding sequence limits that match the d
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix pg_dump's logic for eliding sequence limits that match the d
@ 2018-02-20 16:23 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-02-20 16:23 UTC (permalink / raw)
  To: 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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3486bcf9e89d87b59d0e370af098fda38be97209

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix pg_dump's logic for eliding sequence limits that match the d
@ 2018-02-20 16:23 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-02-20 16:23 UTC (permalink / raw)
  To: 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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-02-20 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20 16:23 pgsql: Fix pg_dump's logic for eliding sequence limits that match the d Tom Lane <tgl@sss.pgh.pa.us>
2018-02-20 16:23 pgsql: Fix pg_dump's logic for eliding sequence limits that match the d Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox