Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit19d0c46

Browse files
committed
pg_restore failed on tar-format archives if they contained large objects
(blobs) with comments, per bug #2727 from Konstantin Pelepelin.Mea culpa for not having tested this case.Back-patch to 8.1; prior branches don't dump blob comments at all.
1 parentc1fdbba commit19d0c46

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

‎src/bin/pg_dump/pg_backup_tar.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
*
1818
* IDENTIFICATION
19-
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.55 2006/10/04 00:30:05 momjian Exp $
19+
*$PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.56 2006/11/01 15:59:26 tgl Exp $
2020
*
2121
*-------------------------------------------------------------------------
2222
*/
@@ -701,6 +701,7 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt)
701701
lclContext*ctx= (lclContext*)AH->formatData;
702702
TAR_MEMBER*th;
703703
size_tcnt;
704+
boolfoundBlob= false;
704705
charbuf[4096];
705706

706707
StartRestoreBlobs(AH);
@@ -725,10 +726,22 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt)
725726
ahwrite(buf,1,cnt,AH);
726727
}
727728
EndRestoreBlob(AH,oid);
729+
foundBlob= true;
728730
}
731+
tarClose(AH,th);
732+
}
733+
else
734+
{
735+
tarClose(AH,th);
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;
729744
}
730-
731-
tarClose(AH,th);
732745

733746
th=tarOpen(AH,NULL,'r');
734747
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp