<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I'm finding that I have a client sending a bunch of bad queries to pgpool. After a large number of these errors pgpool appears to decide that the primary backend is in a bad state and fails over to another backend. Why is pgpool doing this and how do I prevent
 it? Do I need to change failover_on_backend_error to off?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I understand that the right answer is to fix the application. However I don't want my pgpool cluster to keep switching backends because someone writes some bad SQL.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The bad SQL results in the following messages showing up in my log:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
2022-09-01 17:09:52.877: PostgreSQL JDBC Driver pid 2306964: LOG:  Unable to parse the query: "select * from ($1) as result" from client 192.1.192.6(51076)
<div>2022-09-01 17:09:52.878: PostgreSQL JDBC Driver pid 2306964: LOG:  Error message from backend: DB node id: 1 message: "syntax error at or near "$1""</div>
<br>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div></div>
<div></div>
<div></div>
<div></div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<div>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#000000"><b><font color="#000000"><font size="2" style="font-size:10pt">Jon Schewe</font></font></b></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#000000"><font size="2" style="font-size:9pt">Principal Software Systems Technologist</font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#000000"><font color="#c00000"><font size="2" style="font-size:9pt"><b><br>
</b></font></font></font><font color="#000000"><font size="2" style="font-size:9pt">C: +1 612.263.2718<br>
</font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#000000"><font size="2" style="font-size:9pt">O: +1 952.545.5720</font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font color="#0563c1"><font size="2"><u>jon.schewe@raytheon.com</u></font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-top:0.08in; margin-bottom:0.11in; line-height:100%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#000000"><font color="#c00000"><font size="2" style="font-size:9pt"><span lang="fr-BE"><b><br>
</b></span></font></font></font><font color="#000000"><font color="#ce1126"><font size="2" style="font-size:10pt"><span lang="fr-BE"><b>Raytheon BBN</b></span></font></font></font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#000000"><font size="2" style="font-size:9pt">Raytheon Intelligence & Space</font></font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#000000"><font size="2" style="font-size:9pt">5775 Wayzata Blvd. Suite 630</font></font></font></font></p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#000000"><font size="2" style="font-size:9pt">St. Louis Park, MN 55416</font></font></font></font>
</p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:110%">
<br>
</p>
<p style="margin-top:0px; margin-bottom:0px; margin-bottom:0in; line-height:120%">
<font face="Arial, serif"><font size="3" style="font-size:12pt"><font color="#0563c1"><u><a href="https://www.rtx.com/" style="color:rgb(5,99,193)"><font color="#000000"><font size="1" style="font-size:8pt">RTX.com</font></font></a></u></font><font color="#000000"><font color="#000000"><font size="1" style="font-size:8pt"><span style="text-decoration:none">
</span></font></font></font><font color="#ce1126"><font size="2" style="font-size:9pt">|</font></font><font color="#ce1126"><font size="1" style="font-size:8pt">
</font></font><font color="#0563c1"><u><a href="https://www.linkedin.com/company/raytheontechnologies" style="color:rgb(5,99,193)"><font color="#000000"><font size="1" style="font-size:8pt">LinkedIn</font></font></a></u></font><font color="#000000"><font color="#ce1126"><font size="1" style="font-size:8pt"><span style="text-decoration:none">
</span></font></font></font><font color="#ce1126"><font size="2" style="font-size:9pt">|</font></font><font color="#ce1126"><font size="1" style="font-size:8pt">
</font></font><font color="#0563c1"><u><a href="https://twitter.com/raytheontech" style="color:rgb(5,99,193)"><font color="#000000"><font size="1" style="font-size:8pt">Twitter</font></font></a></u></font><font color="#000000"><font color="#ce1126"><font size="1" style="font-size:8pt"><span style="text-decoration:none">
</span></font></font></font><font color="#ce1126"><font size="2" style="font-size:9pt">|</font></font><font color="#ce1126"><font size="1" style="font-size:8pt">
</font></font><font color="#0563c1"><u><a href="https://www.instagram.com/raytheontechnologies" style="color:rgb(5,99,193)"><font color="#000000"><font size="1" style="font-size:8pt">Instagram</font></font></a></u></font><font color="#000000"><font color="#ce1126"><font size="1" style="font-size:8pt"><span style="text-decoration:none">
</span></font></font></font></font></font></p>
<br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>