Re: BUG #2087: Bogus error message on CREATE TRIGGER with a SQL function - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2087: Bogus error message on CREATE TRIGGER with a SQL function
Date
Msg-id 28463.1133501350@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2087: Bogus error message on CREATE TRIGGER with a SQL function  ("Jozef Behran" <jozef.behran@krs.sk>)
List pgsql-bugs
"Jozef Behran" <jozef.behran@krs.sk> writes:
> CREATE FUNCTION tpokus(pokus) RETURNS pokus as $$
>   SELECT $1.id,$1.sval,translate($1.sval,'abc','ABC');
> $$ LANGUAGE SQL IMMUTABLE;

> CREATE TRIGGER trigger_pokus
>   BEFORE INSERT OR UPDATE
>   ON pokus FOR EACH ROW
>   EXECUTE PROCEDURE tpokus()
> ;

> The buggy error message is the line before `ROLLBACK' (the one saying that
> `tpokus' does not exist). The problem is that there *is* a function named
> `tpokus'

But it has the wrong parameter list.  Read the trigger documentation:
trigger functions never take parameters.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Jozef Behran"
Date:
Subject: BUG #2089: Documentation bug: Triggers in plpythonu
Next
From: Tom Lane
Date:
Subject: Re: BUG #2088: logfiles only readable by instance owner