Don't specify the sequence am in UDR.
authorAndres Freund <andres@anarazel.de>
Thu, 21 May 2015 21:03:30 +0000 (23:03 +0200)
committerAndres Freund <andres@anarazel.de>
Thu, 21 May 2015 21:09:00 +0000 (23:09 +0200)
The initial cloning needs more tests, including data, but that requires
larger changes to several tests than I want to do in the fix commit
itself.

Fixes #69

pg_dump/pg_dump.c

index d9f62e131a64d8280859f43fe777fb1172e3c762..9c5a7e082018c57e12f095703f9c0307b73edb0f 100644 (file)
@@ -14276,7 +14276,7 @@ dumpSequence(Archive *fout, TableInfo *tbinfo)
               *maxv = NULL,
               *minv = NULL,
               *cache,
-              *amname = "local";
+              *amname = NULL;
    char        bufm[100],
                bufx[100];
    bool        cycled;
@@ -14421,7 +14421,10 @@ dumpSequence(Archive *fout, TableInfo *tbinfo)
                      "    CACHE %s%s",
                      cache, (cycled ? "\n    CYCLE" : ""));
 
-   appendPQExpBuffer(query, "\n    USING %s", fmtId(amname));
+   /* only dump sequence AM if pg_seqam exists */
+   if (amname)
+       appendPQExpBuffer(query, "\n    USING %s", fmtId(amname));
+
    appendPQExpBufferStr(query, ";\n");
 
    appendPQExpBuffer(labelq, "SEQUENCE %s", fmtId(tbinfo->dobj.name));