Re: triggers and plpgsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jakub Ouhrabka <jouh8664(at)ss1000(dot)ms(dot)mff(dot)cuni(dot)cz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: triggers and plpgsql
Date: 2001-08-03 14:51:22
Message-ID: 20365.996850282@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jakub Ouhrabka <jouh8664(at)ss1000(dot)ms(dot)mff(dot)cuni(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kapil Tilwani 2001-08-03 18:05:25 Referential Integrity thru Views
Previous Message Stephan Szabo 2001-08-03 14:50:53 Re: triggers and plpgsql