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