Fix failure to reconnect as sequence's owner before issuing setval().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 6 Feb 2002 17:27:50 +0000 (17:27 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 6 Feb 2002 17:27:50 +0000 (17:27 +0000)
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_dump.c

index ea36f95970ab654a9807d90d68b5a5ee267ae72b..1204eb4b6415f1fa198ef73c89c93f379c47c267 100644 (file)
@@ -311,9 +311,6 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
 
                if ((reqs & REQ_SCHEMA) != 0)   /* We want the schema */
                {
-                       /* Reconnect if necessary */
-                       _reconnectAsOwner(AH, NULL, te);
-
                        ahlog(AH, 1, "creating %s %s\n", te->desc, te->name);
                        _printTocEntry(AH, te, ropt, false);
                        defnDumped = true;
@@ -2033,6 +2030,9 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isDat
 {
        char       *pfx;
 
+       /* Reconnect if necessary */
+       _reconnectAsOwner(AH, NULL, te);
+
        if (isData)
                pfx = "Data for ";
        else
index 3b6ac0d9f6dbdba3fc32fdf1dbd5c11d7d16163d..6263f058922d96d3fbd0ca805aab5e2149ea4bb2 100644 (file)
@@ -4765,7 +4765,8 @@ dumpSequence(Archive *fout, TableInfo tbinfo, const bool schemaOnly, const bool
                                                  last, (called ? "true" : "false"));
 
                ArchiveEntry(fout, tbinfo.oid, tbinfo.relname, "SEQUENCE SET", NULL,
-                                        query->data, "" /* Del */ , "", "", NULL, NULL);
+                                        query->data, "" /* Del */ , "", tbinfo.usename,
+                                        NULL, NULL);
        }
 
        if (!dataOnly)