[pgpool-general: 5031] Re: Force connection to always go to master

Tatsuo Ishii ishii at sraoss.co.jp
Tue Sep 27 07:50:10 JST 2016


> Hi all,
> 
> I have a master slave setup with automatic failover.  The classic configuration is to have read queries go to the slave and write+read to the master.  However,  this classic routing to slave and master is not so good to me.  I have modules that must read the most recent data and have other modules that for them it is also ok to read data that is 1-2 transactions behind.  Is it possible to (without using functions for each of the statements) to direct the critical read queries to the master and the less critical read queries to the slave.  I use hibernate so I cannot modify the query just play with the connections.
> 
> How can I force a connection to always go to the master

Try:
app_name_redirect_preference_list = '.*:primary'

> How can I force a connection to go to the slave if the slave is alive and go to the master if the slave is dead.

app_name_redirect_preference_list = '.*:standby'

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list