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

Re: plpython triggers TD["new"] = None

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Lee Jensen <ljensen(at)carriersales(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: plpython triggers TD["new"] = None
Date: 2005-01-27 22:34:55
Message-ID: 20050127223455.GA47584@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-bugs
On Thu, Jan 27, 2005 at 03:13:27PM -0700, Lee Jensen wrote:

> I have postgres 7.4.6 installed on 2 machines one debian and one 
> freebsd. Both are the most recent installs of each OS. On both I have 
> the plpython module and both are having the same issue. Essentially when 
> a function is called from a trigger the TD tuple get's populated with 
> all the standard data except new and old have no value (None). Here is 
> the function code I am working with:

[snip]

> CREATE TRIGGER trig
>  BEFORE INSERT OR UPDATE
>  ON public.test
>  FOR EACH STATEMENT
            ^^^^^^^^^
>  EXECUTE PROCEDURE public.test_trigger();

OLD and NEW don't make sense in statement-level triggers because
the statement could affect many rows.  Use FOR EACH ROW if you need
to access the row values.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

pgsql-bugs by date

Next:From: Alvaro HerreraDate: 2005-01-27 22:39:41
Subject: Re: plpython triggers TD["new"] = None
Previous:From: Michael FuhrDate: 2005-01-27 22:20:01
Subject: Re: 8.0.0 make check fails on Solaris 9 (sparc)

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