<div dir="ltr">It just a regular SQL level query. Something like &quot;SELECT * from table where id=$1&quot; along with a parameters array that get substituted for $1. SQL PREPARED STATEMENTS use parametrized query. I&#39;ve reported this issue to the node.js community as well here (<a href="https://github.com/brianc/node-postgres/issues/1255">https://github.com/brianc/node-postgres/issues/1255</a>) , but it seems like this is not node.js or the node sql adapter issue. When I run the same code bypassing pgpool everything runs fine. I have a really simple application so I could easily modify all queries in my code to not use parameters, but I think its a pretty serious limitation.<div><br></div><div>-AJ</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 17, 2017 at 5:37 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I&#39;m not familiar with node.js so I would like to ask you what<br>
&quot;parameterized queries&quot; means here. Is it SQL level ones (PREPARE,<br>
EXECUTE) or using extended query protocol? The info needed to<br>
reproduce the problem.<br>
<span class="im HOEnZb"><br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
<br>
</span><div class="HOEnZb"><div class="h5">&gt; I am not sure if this is related. By in my node.js setup (pg 6.1.5,<br>
&gt; Postgres 9.6 and pgpool-II 3.6.1), parameterized queries just don&#39;t work<br>
&gt; with pg_pool caching. Queries that use parameters like $1 etc run the first<br>
&gt; time (when they are not cached) and then subsequent ones just hang.<br>
&gt; -AJ<br>
&gt;<br>
&gt; On Wed, May 17, 2017 at 4:44 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; &gt; Hello.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; If  I  try to establish connection between pgpool and erlang (using<br>
&gt;&gt; pgapp library <a href="https://github.com/epgsql/pgapp" rel="noreferrer" target="_blank">https://github.com/epgsql/<wbr>pgapp</a>  )<br>
&gt;&gt; &gt; then  session  simply  hangs after erlang  client  sends command<br>
&gt;&gt; &gt; SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname =<br>
&gt;&gt; ANY($1::varchar[])<br>
&gt;&gt; &gt; parameters: $1 = &#39;{hstore,geometry}&#39;<br>
&gt;&gt; &gt; If erlang application connects to PgSQL server directly, then connection<br>
&gt;&gt; is established without problems.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; However, if i connect via psql to pgpool and issue the same statement -<br>
&gt;&gt; &gt; SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname =<br>
&gt;&gt; ANY(&#39;{hstore,geometry}&#39;::<wbr>varchar[]);<br>
&gt;&gt; &gt; then this request is processed normally:<br>
&gt;&gt; &gt;  typname |  oid  | typarray<br>
&gt;&gt; &gt; ---------+-------+----------<br>
&gt;&gt; &gt;  hstore  | 19898 |    19903<br>
&gt;&gt; &gt; (1 row)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; i&#39;ve turned on &quot;debug5&quot; messages and I can see these lines in the pgpool<br>
&gt;&gt; log when erlang library is connecting, but I have no idea what other lines<br>
&gt;&gt; are significant.<br>
&gt;&gt; &gt; May 17 18:02:02 ip-172-31-20-153 [23121]: [432086-1] pgpool2 DEBUG:<br>
&gt;&gt; decide where to send the queries<br>
&gt;&gt; &gt; May 17 18:02:02 ip-172-31-20-153 [23121]: [432086-2] pgpool2 DETAIL:<br>
&gt;&gt; destination = 2 for query= &quot;SELECT typname, oid::int4, typarray::int4 FROM<br>
&gt;&gt; pg_type WHERE typname = ANY($1::varchar[])&quot;<br>
&gt;&gt; &gt; May 17 18:02:02 ip-172-31-20-153 [23121]: [432087-1] pgpool2 DEBUG:<br>
&gt;&gt; system catalog walker, checking relation &quot;pg_type&quot;<br>
&gt;&gt; &gt; May 17 18:02:02 ip-172-31-20-153 [23121]: [432134-1] pgpool2 DEBUG:<br>
&gt;&gt; do_query: extended:1 query:&quot;SELECT count(*) FROM pg_class AS c,<br>
&gt;&gt; pg_namespace AS n WHERE c.oid = to_regclass(&#39;&quot;pg_type&quot;&#39;) AND c.relnamespace<br>
&gt;&gt; = n.oid AND n.nspname = &#39;pg_catalog&#39;&quot;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; and these are lines from the log file if i run this query by hand from<br>
&gt;&gt; psql:<br>
&gt;&gt; &gt; May 17 18:12:24 ip-172-31-20-153 [23539]: [432779-1] pgpool2 DEBUG:<br>
&gt;&gt; decide where to send the queries<br>
&gt;&gt; &gt; May 17 18:12:24 ip-172-31-20-153 [23539]: [432779-2] pgpool2 DETAIL:<br>
&gt;&gt; destination = 2 for query= &quot;SELECT typname, oid::int4, typarray::int4 FROM<br>
&gt;&gt; pg_type WHERE typname = ANY(&#39;{hstore,geometry}&#39;::<wbr>varchar[]);&quot;<br>
&gt;&gt; &gt; May 17 18:12:24 ip-172-31-20-153 [23539]: [432779-3] pgpool2 LOCATION:<br>
&gt;&gt; pool_query_context.c:429<br>
&gt;&gt; &gt; May 17 18:12:24 ip-172-31-20-153 [23539]: [432780-1] pgpool2 DEBUG:<br>
&gt;&gt; system catalog walker, checking relation &quot;pg_type&quot;<br>
&gt;&gt; &gt; May 17 18:12:24 ip-172-31-20-153 [23539]: [432780-2] pgpool2 LOCATION:<br>
&gt;&gt; pool_select_walker.c:374<br>
&gt;&gt; &gt; May 17 18:12:24 ip-172-31-20-153 [23539]: [432781-1] pgpool2 DEBUG:<br>
&gt;&gt; do_query: extended:0 query:&quot;SELECT count(*) FROM pg_class AS c,<br>
&gt;&gt; pg_namespace AS n WHERE c.oid = to_regclass(&#39;&quot;pg_type&quot;&#39;) AND c.relnamespace<br>
&gt;&gt; = n.oid AND n.nspname = &#39;pg_catalog&#39;&quot;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; There is a difference - when request is sent from erlang, then<br>
&gt;&gt; &quot;extended:1&quot;, but when i ru query from psql, then &quot;extended:0&quot;. Perhaps<br>
&gt;&gt; this is important?<br>
&gt;&gt;<br>
&gt;&gt; Maybe. erlang seems to use &quot;extended query&quot;, which is also used in Java.<br>
&gt;&gt;<br>
&gt;&gt; &gt; I understand that it looks like the problem on the erlang library side,<br>
&gt;&gt; but perhaps you, basing on your pgpool knowledge, could suggest what is<br>
&gt;&gt; causing this incompatibility between erlang pgsql library and pgpool?<br>
&gt;&gt; &gt; Perhaps this old thread has something in common with my problem:<br>
&gt;&gt; <a href="http://lists.pgfoundry.org/pipermail/pgpool-general/2011-" rel="noreferrer" target="_blank">http://lists.pgfoundry.org/<wbr>pipermail/pgpool-general/2011-</a><br>
&gt;&gt; February/003409.html ?<br>
&gt;&gt;<br>
&gt;&gt; Not sure. Extended query is pretty complex. Extended query users for<br>
&gt;&gt; Pgpool-II are mostly Java. So it is possible that erlang (or pgapp)<br>
&gt;&gt; reveleas new bug with Pgpool-II. Your Pgpool-II log is imcoplete. To<br>
&gt;&gt; invesigate the problem, I need complete Pgpool-II log: starting from<br>
&gt;&gt; the query issued to the point Pgpool-II hangs.<br>
&gt;&gt;<br>
&gt;&gt; Also please let us know what version of Pgpool-II you using exactly.<br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt; --<br>
&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
&gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt; pgpool-general mailing list<br>
&gt;&gt; <a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
&gt;&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-general</a><br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>