Re: pg_upgradecluster and synchronous replication

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: pgsql-pkg-debian(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgradecluster and synchronous replication
Date: 2026-01-15 04:40:26
Message-ID: c37600b41fec9d87f4a83344acf9623b47c5b2c5.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-debian

On Wed, 2026-01-14 at 20:54 +0100, I wrote:
> On Wed, 2026-01-14 at 20:39 +0100, Christoph Berg wrote:
> >
> > Maybe we should instead change the analyze hook script to do that
> > internally? Setting PGOPTIONS should be enough:
> >
> >     PGOPTIONS="-csynchronous_commit=local"
> >
> >
> > There is already some code in pg_upgradecluster that works around
> > black magic problems:
> >
> >     # ensure we can upgrade DBs with default read-only transactions
> >     $ENV{PGOPTIONS} .= " -cdefault_transaction_read_only=off";
> >
> > This would just add one more wart of that kind.
>
> That looks like a better way to do it, I agree.
>
>
> at makes me wonder. I don't think that it is a great idea to start the cluster for
> production with "synchronous_commit" set to a non-standard value. That would mask the
> problem initially, but whenever the cluster is restarted, the parameter is back to its
> original value, and suddenly things will stop working.

Forget that: I missed that with PGOPTIONS, the setting is only changed for
the database session that performs the ANALYZE, not for the entire server
runtime. Yes, I think that is the proper solution!

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-pkg-debian by date

  From Date Subject
Next Message apt.postgresql.org Repository Update 2026-01-15 12:07:32 pgwatch updated to version 4.1.0-2.pgdg+1
Previous Message apt.postgresql.org Repository Update 2026-01-14 20:32:47 pljs updated to version 1.0.4-1.pgdg+1