]> granicus.if.org Git - postgresql/commitdiff
pg_restore failed to restore blobs if -X disable-triggers is specified.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 9 Mar 2003 19:38:52 +0000 (19:38 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 9 Mar 2003 19:38:52 +0000 (19:38 +0000)
src/bin/pg_dump/pg_backup_archiver.c

index 08666584299bc669cf6bedfcf197e8d9b7f771d4..d91f630b70950f742178cef7ce352160d97f19d3 100644 (file)
@@ -15,7 +15,7 @@
  *
  *
  * IDENTIFICATION
- *             $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.68 2003/02/14 19:40:42 momjian Exp $
+ *             $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.69 2003/03/09 19:38:52 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -294,7 +294,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");
 
@@ -446,6 +447,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);
 
@@ -509,6 +514,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);