Re: pg_restore enhancements

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_restore enhancements
Date: 2023-11-23 16:32:54
Message-ID: CANzqJaAq8qgYOKTieiCqkOwR8dzm_sft-Zw7W9V5PV4oZMdkCg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for the explanation.

On Thu, Nov 23, 2023 at 10:55 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Ron Johnson <ronljohnsonjr(at)gmail(dot)com> writes:
> > On Thu, Nov 23, 2023 at 3:37 AM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
> > wrote:
> >> You can avoidwriting WAL if you set "wal_level = minimal", restart
> >> PostgreSQL
> >> and restore the dump with the --single-transaction option.
>
> > Why does "--single-transaction" prevent WAL writes? I'd expect _more_
> > pg_wal growth from One Ginormous Transaction.
>
> I don't recall all the details offhand, but there's some optimization
> concerned with not writing WAL if COPY's target table was created in
> the current transaction. WAL will still be made for the catalog
> changes, but usually the bulk of the WAL for a pg_restore run comes
> from loading data, and this recipe eliminates that. (Of course,
> you cannot use it on a replication primary.)
>
> regards, tom lane
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Zahir Lalani 2023-11-23 16:55:56 Odd Shortcut behaviour in PG14
Previous Message Adrian Klaver 2023-11-23 16:13:43 Re: Check Code Correction Current Period Prior Period Movement