Re: Create trigger problem : - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Create trigger problem :
Date
Msg-id Pine.BSF.4.21.0103121829380.98920-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Create trigger problem :  ("De Leeuw Guy" <G.De_Leeuw@eurofer.be>)
List pgsql-general
Trigger functions need to take no arguments and return
opaque.  You can use NEW or OLD inside the function and
arguments given in the create trigger statement
are passed into the function in a special way (in
plpgsql, it's TG_ARGV[] i believe)

On Fri, 9 Mar 2001, De Leeuw Guy wrote:

> Hi all,
>
> I try this :
>
> CREATE FUNCTION DelArtFather(INT4)
>  RETURNS INT4
>  AS '
>   DELETE FROM TArticles WHERE IdArtFather = $1;
>   SELECT 1 AS ignore_this
>  '
>  LANGUAGE 'sql';
>
> CREATE TRIGGER trigger_TArticles
>  BEFORE DELETE ON TArticles
>  FOR EACH ROW EXECUTE PROCEDURE DelArtFather(old.IdArt);
>
> and i obtain this error :
>
> ERROR: parse error at or near "old"


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Large Text Fields and TOAST
Next
From: missive@frontiernet.net (Lee Harr)
Date:
Subject: Re: inheritance and primary/foreign keys