SQL Triggers - Mailing list pgsql-hackers

From darcy@druid.net (D'Arcy J.M. Cain)
Subject SQL Triggers
Date
Msg-id m0zKbND-00006FC@druid.net
Whole thread Raw
Responses Re: [HACKERS] SQL Triggers
List pgsql-hackers
Is this an error on my part or is there a bug in the CREATE TRIGGER
code?

darcy=> CREATE FUNCTION function_dead(int)
darcy->     RETURNS int
darcy->     AS 'UPDATE bid SET live = \'f\' WHERE item_id = $1;
darcy'>         SELECT 1 AS ignore_this'
darcy->     LANGUAGE 'sql';
CREATE
darcy=> CREATE TRIGGER trigger_dead BEFORE INSERT OR UPDATE
darcy->     ON bid
darcy->     FOR EACH ROW
darcy->     EXECUTE PROCEDURE function_dead (item_id);
ERROR:  CreateTrigger: function function_dead () does not exist
darcy=> SELECT function_dead(1);
function_dead
-------------
            1
(1 row)

darcy=> DROP FUNCTION function_dead(int);
DROP
darcy=>

Note that the CREATE FUNCTION works as it can be used as in the SELECT
and it can be dropped proving (?) that it existed.  I think I have
all the argument types right.  I tried it with int4 as well.

--
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.

pgsql-hackers by date:

Previous
From: "Billy G. Allie"
Date:
Subject: UnixWare 7 vacuum failures on the regression database.
Next
From: Michael Reifenberger
Date:
Subject: Re: [HACKERS] Indixing problems... (fwd)