Re: triggers and plpgsql - Mailing list pgsql-general

From Tom Lane
Subject Re: triggers and plpgsql
Date
Msg-id 20365.996850282@sss.pgh.pa.us
Whole thread Raw
In response to triggers and plpgsql  (Jakub Ouhrabka <jouh8664@ss1000.ms.mff.cuni.cz>)
List pgsql-general
Jakub Ouhrabka <jouh8664@ss1000.ms.mff.cuni.cz> writes:
> i'm getting strange results when executing the code below. i would expect
> that li_count in function foo and the select after calling this function
> should return same values.

An AFTER trigger runs at the end of the transaction, so it hasn't fired
yet at the time your function foo looks at the table.  Perhaps you want
a BEFORE trigger instead.

            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: triggers and plpgsql
Next
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: HELP! BUG? pg_dump mucks up grant/revoke