Skip site navigation (1) Skip section navigation (2)

Re: After each row trigger NOT seeing data changes?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Karl Nack <karlnack(at)futurityinc(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: After each row trigger NOT seeing data changes?
Date: 2010-02-25 22:24:47
Message-ID: (view raw or whole thread)
Lists: pgsql-general
Tom Lane wrote:
> Karl Nack <karlnack(at)futurityinc(dot)com> writes:
> > I notice the row count does not reflect the newly-inserted row, which 
> > suggests that the trigger is not seeing changes made to the table. This 
> > seems to be exactly opposite of what's in the manual:
> >
> >
> The reason is that you've declared the function STABLE, which causes it
> to use the calling query's starting snapshot.  So it cannot see any
> in-progress changes of the calling query.  Declare it VOLATILE (or
> let it default to that) and it will act as you expect.
> I'm not sure if the cited portions of the manual ought to contain notes
> about this or not.  It seems a bit off-topic for them, but if other
> people have been bit by this, then maybe ... comments anyone?

I have applied the attached documentation patch to subtly mention this

  Bruce Momjian  <bruce(at)momjian(dot)us>
  PG East:
  + If your life is a hard drive, Christ can be your backup. +

Attachment: /rtmp/diff
Description: text/x-diff (1.5 KB)

In response to

pgsql-general by date

Next:From: Bruce MomjianDate: 2010-02-25 23:21:58
Subject: Re: trouble with to_char('L')
Previous:From: Scott MarloweDate: 2010-02-25 20:13:05
Subject: Re: Tool for determining field usage of database tables

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group