[pgpool-general: 5487] pgpool and erlang - request hangs

PVY balroga3 at yandex.ru
Thu May 18 00:17:02 JST 2017


Hello.

If  I  try to establish connection between pgpool and erlang (using pgapp library https://github.com/epgsql/pgapp  )
then  session  simply  hangs after erlang  client  sends command 
SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname = ANY($1::varchar[]) 
parameters: $1 = '{hstore,geometry}'
If erlang application connects to PgSQL server directly, then connection is established without problems.

However, if i connect via psql to pgpool and issue the same statement - 
SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname = ANY('{hstore,geometry}'::varchar[]);
then this request is processed normally:
 typname |  oid  | typarray
---------+-------+----------
 hstore  | 19898 |    19903
(1 row)


i've turned on "debug5" messages and I can see these lines in the pgpool log when erlang library is connecting, but I have no idea what other lines are significant.
May 17 18:02:02 ip-172-31-20-153 [23121]: [432086-1] pgpool2 DEBUG:  decide where to send the queries
May 17 18:02:02 ip-172-31-20-153 [23121]: [432086-2] pgpool2 DETAIL:  destination = 2 for query= "SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname = ANY($1::varchar[])"
May 17 18:02:02 ip-172-31-20-153 [23121]: [432087-1] pgpool2 DEBUG:  system catalog walker, checking relation "pg_type"
May 17 18:02:02 ip-172-31-20-153 [23121]: [432134-1] pgpool2 DEBUG:  do_query: extended:1 query:"SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.oid = to_regclass('"pg_type"') AND c.relnamespace = n.oid AND n.nspname = 'pg_catalog'"

and these are lines from the log file if i run this query by hand from psql:
May 17 18:12:24 ip-172-31-20-153 [23539]: [432779-1] pgpool2 DEBUG:  decide where to send the queries
May 17 18:12:24 ip-172-31-20-153 [23539]: [432779-2] pgpool2 DETAIL:  destination = 2 for query= "SELECT typname, oid::int4, typarray::int4 FROM pg_type WHERE typname = ANY('{hstore,geometry}'::varchar[]);"
May 17 18:12:24 ip-172-31-20-153 [23539]: [432779-3] pgpool2 LOCATION:  pool_query_context.c:429
May 17 18:12:24 ip-172-31-20-153 [23539]: [432780-1] pgpool2 DEBUG:  system catalog walker, checking relation "pg_type"
May 17 18:12:24 ip-172-31-20-153 [23539]: [432780-2] pgpool2 LOCATION:  pool_select_walker.c:374
May 17 18:12:24 ip-172-31-20-153 [23539]: [432781-1] pgpool2 DEBUG:  do_query: extended:0 query:"SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.oid = to_regclass('"pg_type"') AND c.relnamespace = n.oid AND n.nspname = 'pg_catalog'"

There is a difference - when request is sent from erlang, then "extended:1", but when i ru query from psql, then "extended:0". Perhaps this is important?


I understand that it looks like the problem on the erlang library side, but perhaps you, basing on your pgpool knowledge, could suggest what is causing this incompatibility between erlang pgsql library and pgpool?
Perhaps this old thread has something in common with my problem: http://lists.pgfoundry.org/pipermail/pgpool-general/2011-February/003409.html ?



Thank you.

-- 
Best regards,
 Pavel                          mailto:balroga3 at yandex.ru



More information about the pgpool-general mailing list