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
This commit is contained in:
parent
50be3e5efe
commit
d307a954e7
@ -12,7 +12,7 @@
|
|||||||
* by PostgreSQL
|
* by PostgreSQL
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.324 2003/03/27 16:43:07 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.325 2003/03/31 20:48:45 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -6171,9 +6171,13 @@ dumpOneSequence(Archive *fout, TableInfo *tbinfo,
|
|||||||
|
|
||||||
resetPQExpBuffer(query);
|
resetPQExpBuffer(query);
|
||||||
appendPQExpBuffer(query,
|
appendPQExpBuffer(query,
|
||||||
"CREATE SEQUENCE %s\n START WITH %s\n INCREMENT BY %s\n",
|
"CREATE SEQUENCE %s\n",
|
||||||
fmtId(tbinfo->relname),
|
fmtId(tbinfo->relname));
|
||||||
(called ? minv : last), incby);
|
|
||||||
|
if (!called)
|
||||||
|
appendPQExpBuffer(query, " START WITH %s\n", last);
|
||||||
|
|
||||||
|
appendPQExpBuffer(query, " INCREMENT BY %s\n", incby);
|
||||||
|
|
||||||
if (maxv)
|
if (maxv)
|
||||||
appendPQExpBuffer(query, " MAXVALUE %s\n", maxv);
|
appendPQExpBuffer(query, " MAXVALUE %s\n", maxv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user