Re: Experience and feedback on pg_restore --data-only - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Experience and feedback on pg_restore --data-only
Date
Msg-id b61855b9dd042f35c1b1727d30bb92946d3c8c3a.camel@cybertec.at
Whole thread Raw
In response to Re: Experience and feedback on pg_restore --data-only  (Dimitrios Apostolou <jimis@gmx.net>)
List pgsql-general
On Mon, 2025-03-24 at 16:51 +0100, Dimitrios Apostolou wrote:
> Laurenz informed me that I could avoid writing to the WAL if I "create and
> load the table in a single transaction".
> I haven't tried, but here is what I would do to try --single-transaction:
>
> Transaction 1: manually issuing all of CREATE TABLE etc.
>
> Transaction 2: pg_restore --single-transaction --data-only
>
> The COPY command in transaction 2 would still need to write to WAL, since
> it's separate from the CREATE TABLE.
>
> Am I wrong somewhere?

No, that is correct.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Experience and feedback on pg_restore --data-only
Next
From: Phillip Diffley
Date:
Subject: Create replication slot options