aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-03-31 20:48:45 +0000
committerBruce Momjian <bruce@momjian.us>2003-03-31 20:48:45 +0000
commitd307a954e729d560ab9e6730ef2e8c9044878fd3 (patch)
tree891f17ce6e761fdb51d3c8b1c149f934f8baa6ba /src
parent50be3e5efe8da32ffe1bdb8c5e0b99d0ecc159a6 (diff)
downloadpostgresql-d307a954e729d560ab9e6730ef2e8c9044878fd3.tar.gz
postgresql-d307a954e729d560ab9e6730ef2e8c9044878fd3.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_dump.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index cb2eb0d2016..1c6dfe2469f 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* 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);
appendPQExpBuffer(query,
- "CREATE SEQUENCE %s\n START WITH %s\n INCREMENT BY %s\n",
- fmtId(tbinfo->relname),
- (called ? minv : last), incby);
+ "CREATE SEQUENCE %s\n",
+ fmtId(tbinfo->relname));
+
+ if (!called)
+ appendPQExpBuffer(query, " START WITH %s\n", last);
+
+ appendPQExpBuffer(query, " INCREMENT BY %s\n", incby);
if (maxv)
appendPQExpBuffer(query, " MAXVALUE %s\n", maxv);