Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6A18D475F53 for ; Wed, 9 Oct 2002 06:30:10 -0400 (EDT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by postgresql.org (Postfix) with ESMTP id BB1B8475F31 for ; Wed, 9 Oct 2002 06:30:09 -0400 (EDT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 17zE6N-00077n-0U; Wed, 09 Oct 2002 11:30:03 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 2E96016528; Wed, 9 Oct 2002 11:20:28 +0100 (BST) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 9464E1651A; Wed, 9 Oct 2002 11:20:27 +0100 (BST) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: "Rudi Starcevic" , pgsql-sql@postgresql.org Subject: Re: PLPGSQL errors Date: Wed, 9 Oct 2002 11:20:27 +0100 User-Agent: KMail/1.4.3 References: <20021009100633.M18916@oasis.net.au> In-Reply-To: <20021009100633.M18916@oasis.net.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200210091120.27142.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/121 X-Sequence-Number: 9838 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. Tak= e a=20 look at the online manual (Server Programming, chapter 20) or some of the= =20 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'; --=20 Richard Huxton