pg_restore failed to restore blobs if -X disable-triggers is specified.
authorTom Lane <[email protected]>
Sun, 9 Mar 2003 19:38:59 +0000 (19:38 +0000)
committerTom Lane <[email protected]>
Sun, 9 Mar 2003 19:38:59 +0000 (19:38 +0000)
src/bin/pg_dump/pg_backup_archiver.c

index 8a6ec311fcec5538436ba45fbb6e5a6880aec1d8..8941961d1711cb21ef3905a372ceffe34f1fce10 100644 (file)
@@ -293,7 +293,8 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
                                         * Maybe we can't do BLOBS, so check if this node is
                                         * for BLOBS
                                         */
-                                       if ((strcmp(te->desc, "BLOBS") == 0) && !_canRestoreBlobs(AH))
+                                       if ((strcmp(te->desc, "BLOBS") == 0) &&
+                                               !_canRestoreBlobs(AH))
                                        {
                                                ahprintf(AH, "--\n-- SKIPPED \n--\n\n");
 
@@ -445,6 +446,10 @@ _disableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te, RestoreOptions *rop
        if (!ropt->dataOnly || !ropt->disable_triggers)
                return;
 
+       /* Don't do it for the BLOBS TocEntry, either */
+       if (te && strcmp(te->desc, "BLOBS") == 0)
+               return;
+
        oldUser = strdup(AH->currUser);
        oldSchema = strdup(AH->currSchema);
 
@@ -508,6 +513,10 @@ _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt
        if (!ropt->dataOnly || !ropt->disable_triggers)
                return;
 
+       /* Don't do it for the BLOBS TocEntry, either */
+       if (te && strcmp(te->desc, "BLOBS") == 0)
+               return;
+
        oldUser = strdup(AH->currUser);
        oldSchema = strdup(AH->currSchema);