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:

CREATE OR REPLACE FUNCTION public.test_trigger() RETURNS trigger AS
'
plpy.error(TD)

return "OK"
' LANGUAGE 'plpythonu';

The actual trigger is defined as follows:
CREATE TRIGGER trig
 BEFORE INSERT OR UPDATE
 ON public.test
 FOR EACH STATEMENT
 EXECUTE PROCEDURE public.test_trigger();

The following error is generated on both machines when an insert occurs:
ERROR: plpython: function "test_trigger" failed
DETAIL: plpy.Error: ({'relid': '17246', 'old': None, 'name': 'trig', 'level': 'STATEMENT', 'args': None, 'when': 'BEFORE', 'new': None, 'event': 'INSERT'},)


Any help would be appreciated. Most likely I've done something wrong somewhere.

Lee

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
     joining column's datatypes do not match

Reply via email to