[pgpool-general: 1321] pgpool having trouble parsing a query

Philip Hofstetter phofstetter at sensational.ch
Wed Jan 16 22:13:20 JST 2013


Hi,

I'm sending this rather complicated but still valid query to pgpool

with missing_caches as (
    select 369 as uid, cids as cid
    from unnest(array[9089, 9088, 8664, 8665, 1118]) as cids
      left join ptplsets_count_cache on (uid = 369 and cid = cids)
    where cid is null
)
insert into ptplsets_count_cache (uid, cid, count)
    select missing_caches.uid, missing_caches.cid,
count(ptplsets.prodid) as count
    from missing_caches
    left join ptplsets on (ptplsets.cid = missing_caches.cid)
    left join materialized_user_sortiments on
(materialized_user_sortiments.uid = missing_caches.uid and
materialized_user_sortiments.prodid = ptplsets.prodid and
sortiment_status > 0)
where
    ptplsets.deleted is null or not ptplsets.deleted
group by missing_caches.cid, missing_caches.uid

While I get the correct result, I also get a line in syslog

Jan 16 14:06:59 tranquillity pgpool[20813]: SimpleQuery: Unable to
parse the query: "..."

Thankfully pgpool (latest git HEAD from V3_2_STABLE) seems to just
forward the query to master in this case, so the outcome is correct,
but the error message still concerns me a bit, especially considering
that this is running quite often.

In general, I've not yet seen pgpool having issues with CTEs, so if I
had to guess, I would assume it doesn't like the call to unnest().

Any idea how I can help pgpool here? Get rid of the unnest? I still
think pgpool should be able to parse what ever postgres can parse
though.

Philip

--
Sensational AG
Giesshübelstrasse 62c, Postfach 1966, 8021 Zürich
Tel. +41 43 544 09 60, Mobile  +41 79 341 01 99
info at sensational.ch, http://www.sensational.ch


More information about the pgpool-general mailing list