pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
control reaches end of trigger procedure without RETURN
2+ messages / 2 participants
[nested] [flat]

* control reaches end of trigger procedure without RETURN
@ 2002-08-06 22:12 rramostalo@quorum.com
  2002-08-07 13:35 ` Re: control reaches end of trigger procedure without RETURN Jeff Eckermann <jeff_eckermann@yahoo.com>
  0 siblings, 1 reply; 2+ messages in thread

From: rramostalo@quorum.com @ 2002-08-06 22:12 UTC (permalink / raw)
  To: pgsql-sql



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';





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: control reaches end of trigger procedure without RETURN
  2002-08-06 22:12 control reaches end of trigger procedure without RETURN rramostalo@quorum.com
@ 2002-08-07 13:35 ` Jeff Eckermann <jeff_eckermann@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Jeff Eckermann @ 2002-08-07 13:35 UTC (permalink / raw)
  To: rramostalo@quorum.com; 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-08-07 13:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-06 22:12 control reaches end of trigger procedure without RETURN rramostalo@quorum.com
2002-08-07 13:35 ` Jeff Eckermann <jeff_eckermann@yahoo.com>

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