How to send queries to master and failover to slave ?

Поиск
Список
Период
Сортировка
От Benoit Salotti
Тема How to send queries to master and failover to slave ?
Дата
Msg-id CAH9tKGn1QpazJjt6jxGfXO-tDMTYbrBUzxz4cZaESZt==6x_BQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to send queries to master and failover to slave ?  (John R Pierce <pierce@hogranch.com>)
Re: How to send queries to master and failover to slave ?  (Mikko Tiihonen <mikko.tiihonen@nitor.fi>)
Re: How to send queries to master and failover to slave ?  (John R Pierce <pierce@hogranch.com>)
Re: How to send queries to master and failover to slave ?  (Mikko Tiihonen <mikko.tiihonen@nitor.fi>)
RE: How to send queries to master and failover to slave ?  (Švorc Martin <svorc@sefira.cz>)
Список pgsql-jdbc
Hi all,

I have a setup with 1 master and 1 slave (hot standy to serve read queries if necessary).
I would like the JDBC driver to talk preferrably to the master (to be sure to get the freshest data). If the master is not available I would like to send the queries to the slave.

The documentation mentions the following values for the parameter targetServerType: any, master, slave, preferSlave.
I'm surprised there is no preferMaster option which would allow me to implement easily my requirement.

Anyone already encountered the same need ?

Regards,

Benoit

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

Предыдущее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: PostgreSQL query timeout do not stop JDBC client attemptto read data from the server
Следующее
От: John R Pierce
Дата:
Сообщение: Re: How to send queries to master and failover to slave ?