Re: Can I tell libpq to connect to the primary? - Mailing list pgsql-general

From Christian Ramseyer
Subject Re: Can I tell libpq to connect to the primary?
Date
Msg-id 77fdd49c-2977-6e68-1206-fade93701d72@networkz.ch
Whole thread Raw
In response to Can I tell libpq to connect to the primary?  (Christian Ramseyer <rc@networkz.ch>)
Responses Re: Can I tell libpq to connect to the primary?
List pgsql-general
On 22.04.20 21:10, Christian Ramseyer wrote:
> 
> I see that in pgjdbc there are additional options for targetServerType =
> any, primary, secondary, preferSlave and preferSecondary[2]. However
> this seems to be java-specific and not implemented in libpq? Is there a
> way to get this behaviour in PHP/Psycopg/Perl DBI?
> 

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.

Cheers
Christian



pgsql-general by date:

Previous
From: "Peter J. Holzer"
Date:
Subject: Re: How do work tercile, percentile & funcion percentile_cont() ?
Next
From: Stefan Knecht
Date:
Subject: pg11: Query using index, but only for half the partitions