Problem with Function and Trigger ! Urgent !!! - Mailing list pgsql-general

From De Leeuw Guy
Subject Problem with Function and Trigger ! Urgent !!!
Date
Msg-id 98kvcb$3k$1@news.tht.net
Whole thread Raw
List pgsql-general
Hi all
I create this function and this trigger :
Before starting this, I start from the command prompt : createlang plpgsql
myDB

CREATE FUNCTION DelArtFather()
 RETURNS opaque
 AS '
  DELETE FROM TArticles WHERE IdArtFather = OLD.IdArt;
  RETURN OLD;
 '
 LANGUAGE 'plpgsql';

CREATE TRIGGER trigger_TArticles
 BEFORE DELETE ON TArticles
 FOR EACH ROW EXECUTE PROCEDURE DelArtFather();

And I execute the query :
DELETE FROM TArticles WHERE IdArt = 1;
I Receive :
NOTICE: plpgsql: ERROR during compile of delartfather near line 1
ERROR: parse error at or near "DELETE" occured !

Any Idee ?

Guy



pgsql-general by date:

Previous
From: "Russell Hires"
Date:
Subject: Re: Prompt question
Next
From: "De Leeuw Guy"
Date:
Subject: Re: Create trigger problem :