Re: control reaches end of trigger procedure without RETURN - Mailing list pgsql-sql

From Jeff Eckermann
Subject Re: control reaches end of trigger procedure without RETURN
Date
Msg-id 20020807133524.20086.qmail@web20803.mail.yahoo.com
Whole thread Raw
In response to control reaches end of trigger procedure without RETURN  (rramostalo@quorum.com)
List pgsql-sql
The error says it.

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

--- rramostalo@quorum.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


pgsql-sql by date:

Previous
From: Cédric Dufour
Date:
Subject: Views/queries and optimal indexes usage (cf. planner)
Next
From: Wei Weng
Date:
Subject: running psql in a cron job