Attaching v3 of the patch, together with a new test file that tests
previously untested flags of pg_restore.
Added to July's commitfest:
https://commitfest.postgresql.org/patch/5821/
On Thu, 12 Jun 2025, Dimitrios Apostolou wrote:
I wonder about the following in pg_restore.c.
Right now my implementation covers only parallel restore.
In the case of non-parallel restore, I want to make the behaviour similar,
i.e. each worker to issue a TRUNCATE before COPY starts.
But then the StartTransaction() doesn't make sense, as everything might
already be in a transaction because of --single-transaction.
Should I completely skip StartTransaction() if !is_parallel?
In the end, I followed the same code path for both parallel and
non-parallel pg_restore. It works even with --single-transaction, where
apparently there are several nested transactions.
The tests pass, so I assume it's OK to start a subtransaction for each
table restoration inside the global single-transaction.
Dimitris