Return Opaque / Error in Function

From: Knud Müller <k(dot)mueller(at)portrix(dot)net>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Return Opaque / Error in Function
Date: 2001-11-28 15:28:24
Message-ID: NEBBIFELPDEINLGFJBFNEEHCCGAA.k.mueller@portrix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

The following function is executed by a trigger. I'am receiving the error
message following. What am I doing wrong ? Can someone help me ?

Create Function update_productvariant()
RETURNS OPAQUE
AS 'DECLARE
pid text;
BEGIN
pid := old.productvariantid;
Insert into productupdate (productvariantid) values (pid);
RETURN old;
END;'
Language 'plpgsql';

Error:
mag=# Delete from productvariant where productvariantid='4015223929157';
ERROR: control reaches end of trigger procedure without RETURN
DEBUG: Last error occured while executing PL/pgSQL function
update_productvariant
DEBUG: at END of toplevel PL block
ERROR: control reaches end of trigger procedure without RETURN

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message James Orr 2001-11-28 15:38:41 Re: View question
Previous Message Johnny Jørgensen 2001-11-28 14:40:25 PL/pgSQL loops?