Spot the error in my plpgsql... - Mailing list pgsql-general

From Adam Haberlach
Subject Spot the error in my plpgsql...
Date
Msg-id 20010115195426.A4412@newsnipple.com
Whole thread Raw
Responses Re: Spot the error in my plpgsql...  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Spot the error in my plpgsql...  (Mirko Zeibig <mirko@picard.inka.de>)
List pgsql-general
I've got the following procedure...

DROP FUNCTION "blank_referring_devices" ();
CREATE FUNCTION "blank_referring_devices" () RETURNS opaque AS
'
BEGIN
    EXECUTE ''UPDATE t_device SET accountid=NULL WHERE accountid =''
    || quote_literal(OLD.accountid);
END;
'
LANGUAGE 'plpgsql';

DROP TRIGGER "t_account_blank_devrel" ON "t_account";
CREATE TRIGGER "t_account_blank_devrel" BEFORE DELETE ON "t_account"
FOR EACH ROW EXECUTE PROCEDURE "blank_referring_devices" ();

And when I delete an account, I get the following:

test=# delete from t_account where accountid='6084751D55C11C3704B14FD4A87F3F7B';
ERROR:  parser: parse error at or near "execute"

Any ideas?

--
Adam Haberlach            |A cat spends her life conflicted between a
adam@newsnipple.com       |deep, passionate, and profound desire for
http://www.newsnipple.com |fish and an equally deep, passionate, and
'88 EX500                 |profound desire to avoid getting wet.

pgsql-general by date:

Previous
From: "Mike Miller"
Date:
Subject: Re: problem running initdb
Next
From: Tom Lane
Date:
Subject: Re: Spot the error in my plpgsql...