[pgpool-general: 279] Re: Timestamp problem again

Tatsuo Ishii ishii at postgresql.org
Mon Mar 12 21:59:01 JST 2012


> The easiest way to reproduce the problem is as follows:
> 1. Create table and trigger
> # CREATE TABLE foo (trigger BOOLEAN, time TIME);
> 
> # CREATE FUNCTION bar() RETURNS TRIGGER AS
> $BODY$
> BEGIN
>  IF NEW.trigger = 't' THEN
>    NEW.time := NOW();
>  END IF;
>  RETURN NEW;
> END
> $BODY$
> LANGUAGE plpgsql VOLATILE;
> 
> # CREATE TRIGGER bar BEFORE UPDATE ON foo FOR EACH ROW EXECUTE PROCEDURE bar();
> 
> 2. Test:
> # INSERT INTO foo VALUES('f', NOW());
> This will work correctly.
> 
> # UPDATE foo SET trigger='t';
> This will result in backend desynchronisation.

I can't think of any way without changing your trigger or UPDATE SQL. Sorry.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the pgpool-general mailing list