Skip to content

Commit d307a95

Browse files
committed
Skip START WITH in sequence definition when it's the default value --
and hasn't been called yet. Fixes bug where it wasn't supplied (due to being NULL). Rod Taylor
1 parent 50be3e5 commit d307a95

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.324 2003/03/27 16:43:07 momjian Exp $
15+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.325 2003/03/31 20:48:45 momjian Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -6171,9 +6171,13 @@ dumpOneSequence(Archive *fout, TableInfo *tbinfo,
61716171

61726172
resetPQExpBuffer(query);
61736173
appendPQExpBuffer(query,
6174-
"CREATE SEQUENCE %s\n START WITH %s\n INCREMENT BY %s\n",
6175-
fmtId(tbinfo->relname),
6176-
(called ? minv : last), incby);
6174+
"CREATE SEQUENCE %s\n",
6175+
fmtId(tbinfo->relname));
6176+
6177+
if (!called)
6178+
appendPQExpBuffer(query, " START WITH %s\n", last);
6179+
6180+
appendPQExpBuffer(query, " INCREMENT BY %s\n", incby);
61776181

61786182
if (maxv)
61796183
appendPQExpBuffer(query, " MAXVALUE %s\n", maxv);

0 commit comments

Comments
 (0)