pl/pythonu and Triggers

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • C G

    pl/pythonu and Triggers

    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



    ---------------------------(end of broadcast)---------------------------
    TIP 4: Don't 'kill -9' the postmaster

Working...