From: Michael Paquier <michael@paquier.xyz>
To: Christian Ramseyer <rc@networkz.ch>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Can I tell libpq to connect to the primary?
Date: Fri, 24 Apr 2020 16:12:50 +0900
Message-ID: <20200424071250.GN33034@paquier.xyz> (raw)
In-Reply-To: <77fdd49c-2977-6e68-1206-fade93701d72@networkz.ch>
References: <da508681-20be-1741-3bb1-25910ca22ae1@networkz.ch>
<77fdd49c-2977-6e68-1206-fade93701d72@networkz.ch>
On Thu, Apr 23, 2020 at 08:54:35AM +0200, Christian Ramseyer wrote:
> Never mind, after RTFM'ing to the very end of
> https://www.postgresql.org/docs/current/libpq-connect.html I have
> discovered target_session_attrs=read-write|any which seems to do exactly
> what I want.
Yes, as long as you don't have as requirement to make sure to connect
to a standby session this would not be a problem. Supporting a
read-only mode for target_session_attrs is a problem we have been
stuck on for some time because of the potential issues you could face
when attempting to connect a cluster that has just been freshly
promoted: when connecting to the server libpq may see the connection
as read-only but if the standby gets promoted that could become
incorrect.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: michael@paquier.xyz, rc@networkz.ch
Subject: Re: Can I tell libpq to connect to the primary?
In-Reply-To: <20200424071250.GN33034@paquier.xyz>
References: <da508681-20be-1741-3bb1-25910ca22ae1@networkz.ch> <77fdd49c-2977-6e68-1206-fade93701d72@networkz.ch> <20200424071250.GN33034@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox