pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Rudi Starcevic <rudi@oasis.net.au>
To: pgsql-sql@postgresql.org
Subject: Re: PLPGSQL errors
Date: Wed, 9 Oct 2002 11:20:27 +0100
Message-ID: <200210091120.27142.dev@archonet.com> (raw)
In-Reply-To: <20021009100633.M18916@oasis.net.au>
References: <20021009100633.M18916@oasis.net.au>

On Wednesday 09 Oct 2002 11:06 am, Rudi Starcevic wrote:
>
> error:
> [postgres@central postgres]$ /usr/local/pgsql/bin/psql demo -f
> sysinsert.sql psql:sysinsert.sql:16: NOTICE:  Error occurred while
> executing PL/pgSQL function fn_sysmessages_log
> psql:sysinsert.sql:16: NOTICE:  at END of toplevel PL block
> psql:sysinsert.sql:16: ERROR:  control reaches end of trigger procedure
> without RETURN

Look carefully - you don't have a RETURN new/old/null in your function. Take a 
look at the online manual (Server Programming, chapter 20) or some of the 
samples in Roberto's PostgreSQL cookbook (http://techdocs.postgresql.org)

> function :
> CREATE function fn_sysmessages_log() RETURNS OPAQUE AS '
> BEGIN
> INSERT INTO sysmessages_log
>        (
>        id,
>        user_id,
>        message_date,
>        message_priority,
>        message,
>        status
>        )
> VALUES
>         (
>         NEW.id,
>         NEW.user_id,
>         NEW.message_date,
>         NEW.message_priority,
>         NEW.message,
>         NEW.status
>         );
> END;
> ' LANGUAGE 'plpgsql';

-- 
  Richard Huxton



view thread (2+ messages)

Message-ID: <200210091120.27142.dev@archonet.com>
Permalink:  ../200210091120.27142.dev@archonet.com/
Also on:    postgresql.org/message-id/200210091120.27142.dev@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, rudi@oasis.net.au
  Subject: Re: PLPGSQL errors
  In-Reply-To: <200210091120.27142.dev@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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