[pgpool-general: 4916] select count(*) as dummy from update_tbl1() goes to slave event when update_tbl1() is update function
Avi Weinberg
AviW at gilat.com
Wed Aug 17 17:07:56 JST 2016
Hi,
In my system we had a workaround because of some system problem that we call a function as "select count(*) as dummy from update_tbl1()" instead of "select update_tbl1()" as a result pgpool directs this call to the slave even when update_tbl1() is updating the database.
Your input is most welcome!
create table tbl1 (b int)
insert into tbl1 (b) values (1)
CREATE OR REPLACE FUNCTION public.update_tbl1()
RETURNS void AS
$BODY$
BEGIN
update tbl1 set b = b+1;
END
$BODY$
LANGUAGE plpgsql VOLATILE
select count(*) as dummy from update_tbl1()
IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20160817/9bc9f41f/attachment.htm>
More information about the pgpool-general
mailing list