8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1fdbba commit 19d0c46Copy full SHA for 19d0c46
src/bin/pg_dump/pg_backup_tar.c
@@ -16,7 +16,7 @@
16
*
17
18
* IDENTIFICATION
19
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.55 2006/10/04 00:30:05 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.56 2006/11/01 15:59:26 tgl Exp $
20
21
*-------------------------------------------------------------------------
22
*/
@@ -701,6 +701,7 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt)
701
lclContext *ctx = (lclContext *) AH->formatData;
702
TAR_MEMBER *th;
703
size_t cnt;
704
+ bool foundBlob = false;
705
char buf[4096];
706
707
StartRestoreBlobs(AH);
@@ -725,10 +726,22 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt)
725
726
ahwrite(buf, 1, cnt, AH);
727
}
728
EndRestoreBlob(AH, oid);
729
+ foundBlob = true;
730
731
+ tarClose(AH, th);
732
+ }
733
+ else
734
+ {
735
736
+ /*
737
+ * Once we have found the first blob, stop at the first
738
+ * non-blob entry (which will be 'blobs.toc'). This coding would
739
+ * eat all the rest of the archive if there are no blobs ... but
740
+ * this function shouldn't be called at all in that case.
741
+ */
742
+ if (foundBlob)
743
+ break;
744
-
- tarClose(AH, th);
745
746
th = tarOpen(AH, NULL, 'r');
747