Bug #440: trigger can not find a function

PostgreSQL Bugs List <pgsql-bugs@postgresql.org>

From: pgsql-bugs@postgresql.org
To: pgsql-bugs@postgresql.org
Date: 2001-09-06T14:34:07Z
Lists: pgsql-bugs
arnauld michelizza (am@adomos.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
trigger can not find a function

Long Description
ERROR:  CreateTrigger: function check_key() does not exist


Sample Code
CREATE FUNCTION check_key(varchar,varchar) RETURNS OPAQUE AS '
BEGIN
    IF COUNT(*) FROM $2 WHERE $2.$1=NEW.$1 THEN
           RAISE EXCEPTION ''integrity violation : duplicated key'';
    END IF;
    RETURN NEW;
END;
' LANGUAGE 'plpgsql';

CREATE TRIGGER trigger_check_key BEFORE INSERT OR UPDATE 
ON bar 
FOR EACH ROW EXECUTE PROCEDURE check_key('id','foo');


No file was uploaded with this report