From: | "Godfrin, Philippe E" <philippe(dot)godfrin(at)nov(dot)com> |
---|---|
To: | <laurenz(dot)albe(at)cybertec(dot)at>, <pgsql-admin(at)lists(dot)postgresql(dot)org> |
Subject: | RE: [EXTERNAL] Re: FDW, connections, master v replica |
Date: | 2021-05-19 17:52:15 |
Message-ID: | SA0PR15MB393392B4337717D1460E8B06822B9@SA0PR15MB3933.namprd15.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
OK, thanks!
From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Sent: Wednesday, May 19, 2021 11:39 AM
To: Godfrin, Philippe E <Philippe(dot)Godfrin(at)nov(dot)com>; pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: [EXTERNAL] Re: FDW, connections, master v replica
Use caution when interacting with this [EXTERNAL] email!
On Wed, 2021-05-19 at 15:45 +0000, Godfrin, Philippe E wrote:
> From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
> >On Tue, 2021-05-18 at 16:13 +0000, Godfrin, Philippe E wrote:
> > > 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’
> >
> > Pretty much, yes. Except you can only specify a single setting for
> > "target_session_attrs".
>
> OK – so using target_session_attr=’read-write’ will use the show transaction_read_only
> command – if the reply is ‘on’ the connection is closed, which will then go to the next
> host/port combination…
> Seems to me, then, it’s the libpq operation that permits the selection…
Yes, the postgres_fdw options are mostly libpq connection parameters.
> Hmm, wait a minute. Then how do you segregate connections by RO ?? I can’t wait until v14
Right. If you cannot wait for v14, that is hard luck.
You could use a load balancer, perhaps that can be configured to check
"pg_is_in_recovery()".
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
From | Date | Subject | |
---|---|---|---|
Next Message | Rocco Kreutz | 2021-05-21 12:02:56 | Secure LDAP auth on windows machine inside domain |
Previous Message | Laurenz Albe | 2021-05-19 16:38:50 | Re: [EXTERNAL] Re: FDW, connections, master v replica |