pgsql: Skip second WriteToc() call for custom-format dumps without data

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Skip second WriteToc() call for custom-format dumps without data
Date: 2025-04-04 19:51:56
Message-ID: E1u0n52-002gUH-2G@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)j-davis(dot)com>
Discussion: https://postgr.es/m/Z9c1rbzZegYQTOQE%40nathan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e3cc039a7d930ffe86e706944a2b3368bd3ef506

Modified Files
--------------
src/bin/pg_dump/pg_backup_custom.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2025-04-04 19:55:47 pgsql: Remove unused function parameters in pg_backup_archiver.c.
Previous Message Melanie Plageman 2025-04-04 19:29:26 pgsql: Remove superfluous autoprewarm check