jdbc targetServerType=slave with readonly connection - Mailing list pgsql-hackers

From Vladimír Houba ml.
Subject jdbc targetServerType=slave with readonly connection
Date
Msg-id CAP=jTS467X_Pd1yosBvevA+6gB-2YHL6UzLdhJBgBXmRrhtmzw@mail.gmail.com
Whole thread Raw
Responses Re: jdbc targetServerType=slave with readonly connection
Re: jdbc targetServerType=slave with readonly connection
List pgsql-hackers
Hello,

the slave replication server does not seem to be recognized correctly when using read-only jdbc connection and targetServerType=preferSlave.

Sample conn str
<entry key="jdbc.url.readonly">jdbc:postgresql://master,slave/up?user=***&password=***&sslmode=require&ApplicationName=***&targetServerType=preferSlave&loadBalanceHosts=true&readOnly=true</entry>

From the docs I understands that since writes are not allowed in RO transactions, the jdbc driver thinks it is connected to a slave. I think the master/slave check should be corrected, or configurable.

Docs:
The master/slave distinction is currently done by observing if the server allows writes

Thank you
Vladimir

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Deadlock in XLogInsert at AIX
Next
From: Jeff Davis
Date:
Subject: Re: Rangejoin rebased