pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Godfrin, Philippe E <philippe.godfrin@nov.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: FDW, connections, master v replica
Date: Tue, 18 May 2021 16:44:33 +0200
Message-ID: <49ed5b6a7a44f245676db39d8c6c2b1f55035eac.camel@cybertec.at> (raw)
In-Reply-To: <SA0PR15MB3933C775A0B3D498741C22B2822C9@SA0PR15MB3933.namprd15.prod.outlook.com>
References: <SA0PR15MB3933C775A0B3D498741C22B2822C9@SA0PR15MB3933.namprd15.prod.outlook.com>

On Tue, 2021-05-18 at 13:57 +0000, Godfrin, Philippe E wrote:
> Does anyone know of a method to define a foreign server to point to a patroni
>  cluster of 2 postgres cluster instances and be able to select between the master for RW and the replica for RO?

Use the "target_session_attrs" connection parameter.

It can be used to always connect to the primary, and from v14 on
it can also be used to preferably connect to the standby.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (9+ messages)  latest in thread

Message-ID: <49ed5b6a7a44f245676db39d8c6c2b1f55035eac.camel@cybertec.at>
Permalink:  ../49ed5b6a7a44f245676db39d8c6c2b1f55035eac.camel@cybertec.at/
Also on:    postgresql.org/message-id/49ed5b6a7a44f245676db39d8c6c2b1f55035eac.camel@cybertec.at

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, philippe.godfrin@nov.com, pgsql-admin@lists.postgresql.org
  Subject: Re: FDW, connections, master v replica
  In-Reply-To: <49ed5b6a7a44f245676db39d8c6c2b1f55035eac.camel@cybertec.at>

* 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