RE: [EXTERNAL] Re: FDW, connections, master v replica

Поиск
Список
Период
Сортировка
От Godfrin, Philippe E
Тема RE: [EXTERNAL] Re: FDW, connections, master v replica
Дата
Msg-id SA0PR15MB393394768B6A3F3B6EF17CD5822C9@SA0PR15MB3933.namprd15.prod.outlook.com
обсуждение исходный текст
Список pgsql-admin

Hi Laurenz,

 

That seems very promising, though I’m not certain how I’d code that in the create foreign server syntax. My testbed is not quire ready right now, so I’ll ask instead of testing.

Is this what you mean:

 

CREATE SERVER FDW001 FOREIGN DATA WRAPPER POSTGES_FDW

OPTIONS (HOST ‘FOORW, FOORO’, DBNAME ‘FOODB,FOODB’, PORT ‘5432,6432’,

   TARGET_SESSION_ATTRS ‘ANY,READ-ONLY’

;

 

From: Laurenz Albe <laurenz.albe@cybertec.at>
Sent: Tuesday, May 18, 2021 9:45 AM
To: Godfrin, Philippe E <Philippe.Godfrin@nov.com>; pgsql-admin@lists.postgresql.org
Subject: [EXTERNAL] Re: FDW, connections, master v replica

 

Use caution when interacting with this [EXTERNAL] email!

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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Vijaykumar Jain
Дата:
Сообщение: Re: FDW, connections, master v replica
Следующее
От: "Godfrin, Philippe E"
Дата:
Сообщение: RE: [EXTERNAL] Re: FDW, connections, master v replica