Re: control reaches end of trigger procedure without RETURN

From: Jeff Eckermann <jeff_eckermann(at)yahoo(dot)com>
To: rramostalo(at)quorum(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: control reaches end of trigger procedure without RETURN
Date: 2002-08-07 13:35:24
Message-ID: 20020807133524.20086.qmail@web20803.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

The error says it.

In this case, you need to add "return NEW;" before the
"end;"

--- rramostalo(at)quorum(dot)com wrote:
>
>
> create function duplicate_images() returns OPAQUE
> as'
> DECLARE
> myrec RECORD;
> BEGIN
> if TG_OP = ''INSERT'' then
> select * into myrec from images where
> page=NEW.page and
> path=NEW.path;
> if found then
> raise exception ''insert failed:
> duplicate record found'';
> end if;
> end if;
> end;
> ' language 'plpgsql';
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Yuri Gordienko 2002-08-07 14:29:16 Table is modified?
Previous Message Cédric Dufour 2002-08-07 11:49:11 Views/queries and optimal indexes usage (cf. planner)