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

Commite3cc039

Browse files
Skip second WriteToc() call for custom-format dumps without data.
Presently, "pg_dump --format=custom" calls WriteToc() twice. Thesecond call updates the data offset information, which allegedlymakes parallel pg_restore significantly faster. However, if we'renot dumping any data, there are no data offsets to update, so wecan skip this step.Reviewed-by: Jeff Davis <pgsql@j-davis.com>Discussion:https://postgr.es/m/Z9c1rbzZegYQTOQE%40nathan
1 parentd9c7911 commite3cc039

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/bin/pg_dump/pg_backup_custom.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,9 +755,11 @@ _CloseArchive(ArchiveHandle *AH)
755755
* If possible, re-write the TOC in order to update the data offset
756756
* information. This is not essential, as pg_restore can cope in most
757757
* cases without it; but it can make pg_restore significantly faster
758-
* in some situations (especially parallel restore).
758+
* in some situations (especially parallel restore). We can skip this
759+
* step if we're not dumping any data; there are no offsets to update
760+
* in that case.
759761
*/
760-
if (ctx->hasSeek&&
762+
if (ctx->hasSeek&&AH->public.dopt->dumpData&&
761763
fseeko(AH->FH,tpos,SEEK_SET)==0)
762764
WriteToc(AH);
763765
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp