X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 52C7C529DA for ; Fri, 29 Jul 2005 11:45:46 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59174-06 for ; Fri, 29 Jul 2005 14:45:41 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 3B59A529D6 for ; Fri, 29 Jul 2005 11:45:40 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j6TEjYQQ029644 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 29 Jul 2005 08:45:37 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j6TEjYKN084112; Fri, 29 Jul 2005 08:45:34 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j6TEjXal084111; Fri, 29 Jul 2005 08:45:33 -0600 (MDT) (envelope-from mfuhr) Date: Fri, 29 Jul 2005 08:45:33 -0600 From: Michael Fuhr To: gherzig@fmed.uba.ar Cc: pgsql-sql@postgresql.org Subject: Re: calling EXECUTE on any exception Message-ID: <20050729144533.GA84062@winnie.fuhr.org> References: <35926.157.92.152.53.1122644212.squirrel@webmail.fmed.uba.ar> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35926.157.92.152.53.1122644212.squirrel@webmail.fmed.uba.ar> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/242 X-Sequence-Number: 22220 On Fri, Jul 29, 2005 at 10:36:52AM -0300, gherzig@fmed.uba.ar wrote: > EXCEPTION > WHEN OTHER THEN > EXECUTE exception_handler(Exception_code) > > how do i get that error_code (or code_name, whatever i can get) > generated in the something() function to be proccesed by the > exception_handler() function? I don't think you can do this in released versions of PostgreSQL. In 8.1 you'll be able to use SQLSTATE to get the error code and SQLERRM to get the error message. -- Michael Fuhr http://www.fuhr.org/~mfuhr/