Skip second WriteToc() call for custom-format dumps without data.
authorNathan Bossart <nathan@postgresql.org>
Fri, 4 Apr 2025 19:51:08 +0000 (14:51 -0500)
committerNathan Bossart <nathan@postgresql.org>
Fri, 4 Apr 2025 19:51:08 +0000 (14:51 -0500)
commite3cc039a7d930ffe86e706944a2b3368bd3ef506
treeb706ccf7a4f8a8d09bad99e6ac4206362c1926f3
parentd9c7911e1a5f354b7c34b7f53a52e0a690e7ebc9
Skip second WriteToc() call for custom-format dumps without data.

Presently, "pg_dump --format=custom" calls WriteToc() twice.  The
second call updates the data offset information, which allegedly
makes parallel pg_restore significantly faster.  However, if we're
not dumping any data, there are no data offsets to update, so we
can skip this step.

Reviewed-by: Jeff Davis <pgsql@j-davis.com>
Discussion: https://postgr.es/m/Z9c1rbzZegYQTOQE%40nathan
src/bin/pg_dump/pg_backup_custom.c