From: Tom Lane Date: Sun, 9 Mar 2003 19:38:59 +0000 (+0000) Subject: pg_restore failed to restore blobs if -X disable-triggers is specified. X-Git-Tag: REL7_3_3~65 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db825e3743fc789b99c5604e3740de195d129b00;p=postgresql pg_restore failed to restore blobs if -X disable-triggers is specified. --- diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index c89b53bc50..3a045e830b 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.62.2.2 2003/02/01 22:07:14 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.62.2.3 2003/03/09 19:38:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -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);