[pgpool-hackers: 1041] WITH clause in INSERT/UPDATE in replication mode

Yugo Nagata nagata at sraoss.co.jp
Fri Sep 4 14:00:35 JST 2015


Hi,

I'm now working on importing PG 9.5 parser to pgpool-II 3.5.
In the work, I found that pgpool-II doesn't support WITH clause
in INSERT/UPDATE. The problem is when rewriting timestamp queries,
there is no problem at the parsing phase.

In replication mode, the folowing query, which succeeds in 
PostgreSQL 9.4, fails in pgpool.

 CREATE TABLE test (t timestamp default now());

 WITH v AS (now() AS t)
 UPDATE test SET t = default
 FROM v
 WHERE test.v < v.t;

The error message is "ERROR: relation "v" does not exist" because 
WITH cluase is missing int the query sent to backend as below;

 UPDATE "test" SET "t" = '2015-09-04 13:53:05.544206+09'
 FROM "v" WHERE ("test"."t"<"v"."t")

I think outfuncs.c doesn't output WITH caluse in INSERT/UPDATE and
should be fixed.

-- 
Yugo Nagata <nagata at sraoss.co.jp>


More information about the pgpool-hackers mailing list