Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A56F59FBE34 for ; Wed, 30 May 2007 11:14:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 74218-05 for ; Wed, 30 May 2007 11:13:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 033D49FBEBB for ; Wed, 30 May 2007 11:13:58 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id l4UEDomv083982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 30 May 2007 08:13:53 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id l4UEDol2076770; Wed, 30 May 2007 08:13:50 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id l4UEDnbB076769; Wed, 30 May 2007 08:13:49 -0600 (MDT) (envelope-from mfuhr) Date: Wed, 30 May 2007 08:13:49 -0600 From: Michael Fuhr To: Bart Degryse Cc: pgsql-sql@postgresql.org Subject: Re: spi and error messages Message-ID: <20070530141349.GA76707@winnie.fuhr.org> References: <465D44F3.A3DD.0030.0@indicator.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <465D44F3.A3DD.0030.0@indicator.be> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/190 X-Sequence-Number: 28470 On Wed, May 30, 2007 at 09:33:40AM +0200, Bart Degryse wrote: > In general how should I catch the error message generated if one > of the spi functions (spi_exec_query, spi_query, spi_fetchrow, > spi_prepare,...) fails? In PL/Perl functions you can use eval to catch errors just as you would in an ordinary Perl script: eval { do something }; if ($@) { handle the error } -- Michael Fuhr