pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedReturn Opaque / Error in Function
2+ messages / 2 participants
[nested] [flat]
* Return Opaque / Error in Function
@ 2001-11-28 15:28 Knud Müller <k.mueller@portrix.net>
2001-11-29 06:15 ` Re: Return Opaque / Error in Function Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Knud Müller @ 2001-11-28 15:28 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Return Opaque / Error in Function
2001-11-28 15:28 Return Opaque / Error in Function Knud Müller <k.mueller@portrix.net>
@ 2001-11-29 06:15 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2001-11-29 06:15 UTC (permalink / raw)
To: Knud Müller <k.mueller@portrix.net>; +Cc: pgsql-sql
=?iso-8859-1?Q?Knud_M=FCller?= <k.mueller@portrix.net> writes:
> 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
Your function looks fine to me, and executes fine here. Not sure what
the problem is. You are using a recent version of Postgres, no?
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-11-29 06:15 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-28 15:28 Return Opaque / Error in Function Knud Müller <k.mueller@portrix.net>
2001-11-29 06:15 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox