pl/pythonu and Triggers

From: "C G" <csgcsg39(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pl/pythonu and Triggers
Date: 2004-02-10 14:48:24
Message-ID: LAW12-F18Xg5wlSe9F60000288b@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear All,

I'm trying to use pythonu and triggers, but can't seem to get it to work.
Could someone give me an example of it in action. For example, could someone
supply the CODE in the function below that ignores whatever is inserted and
puts in 'hello' 'World' instead?

Thanks

Colin

CREATE TABLE t1 (col1 text, col2 text);

CREATE FUNCTION simple() RETURNS TRIGGER AS'
CODE
'LANGUAGE plpythonu;

CREATE TRIGGER simple BEFORE insert
on t1 FOR EACH ROW EXECUTE
PROCEDURE simple();

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger
http://www.msn.co.uk/messenger

Browse pgsql-general by date

  From Date Subject
Next Message Francisco 2004-02-10 14:54:18 Re: Transfer database tables to a schema
Previous Message Jan Wieck 2004-02-10 14:45:14 Re: I want to use postresql for this app, but...