diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
new file mode 100644
index 06bbc50..d9d331e
*** a/src/bin/pg_dump/pg_dump.c
--- b/src/bin/pg_dump/pg_dump.c
*************** dumpSequence(Archive *fout, TableInfo *t
*** 16914,16936 ****
  
  	is_ascending = incby[0] != '-';
  
! 	if (is_ascending && atoi(minv) == 1)
  		minv = NULL;
! 	if (!is_ascending && atoi(maxv) == -1)
  		maxv = NULL;
  
  	if (strcmp(seqtype, "smallint") == 0)
  	{
! 		if (!is_ascending && atoi(minv) == PG_INT16_MIN)
  			minv = NULL;
! 		if (is_ascending && atoi(maxv) == PG_INT16_MAX)
  			maxv = NULL;
  	}
  	else if (strcmp(seqtype, "integer") == 0)
  	{
! 		if (!is_ascending && atoi(minv) == PG_INT32_MIN)
  			minv = NULL;
! 		if (is_ascending && atoi(maxv) == PG_INT32_MAX)
  			maxv = NULL;
  	}
  	else if (strcmp(seqtype, "bigint") == 0)
--- 16914,16936 ----
  
  	is_ascending = incby[0] != '-';
  
! 	if (is_ascending && atol(minv) == 1)
  		minv = NULL;
! 	if (!is_ascending && atol(maxv) == -1)
  		maxv = NULL;
  
  	if (strcmp(seqtype, "smallint") == 0)
  	{
! 		if (!is_ascending && atol(minv) == PG_INT16_MIN)
  			minv = NULL;
! 		if (is_ascending && atol(maxv) == PG_INT16_MAX)
  			maxv = NULL;
  	}
  	else if (strcmp(seqtype, "integer") == 0)
  	{
! 		if (!is_ascending && atol(minv) == PG_INT32_MIN)
  			minv = NULL;
! 		if (is_ascending && atol(maxv) == PG_INT32_MAX)
  			maxv = NULL;
  	}
  	else if (strcmp(seqtype, "bigint") == 0)
