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 2A74352A14 for ; Fri, 29 Jul 2005 12:56:45 -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 76605-04 for ; Fri, 29 Jul 2005 15:56:35 +0000 (GMT) Received: from fmed.uba.ar (mail.fmed.uba.ar [157.92.152.1]) by svr1.postgresql.org (Postfix) with ESMTP id F3CE652A44 for ; Fri, 29 Jul 2005 12:56:34 -0300 (ADT) Received: from www.webmail.fmed.uba.ar (localhost [127.0.0.1]) by fmed.uba.ar (Postfix) with SMTP id C33CB1749D for ; Fri, 29 Jul 2005 12:59:28 -0300 (ART) Received: from 157.92.152.3 (SquirrelMail authenticated user gherzig) by www.webmail.fmed.uba.ar with HTTP; Fri, 29 Jul 2005 12:59:28 -0300 (ART) Message-ID: <2081.157.92.152.3.1122652768.squirrel@www.webmail.fmed.uba.ar> In-Reply-To: <20050729144533.GA84062@winnie.fuhr.org> References: <35926.157.92.152.53.1122644212.squirrel@webmail.fmed.uba.ar> <20050729144533.GA84062@winnie.fuhr.org> Date: Fri, 29 Jul 2005 12:59:28 -0300 (ART) Subject: Re: calling EXECUTE on any exception From: gherzig@fmed.uba.ar To: pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.178 tagged_above=0 required=5 tests=NO_REAL_NAME X-Spam-Level: X-Archive-Number: 200507/244 X-Sequence-Number: 22222 Oh...to bad...Thank you Michael! Did someone know if it can be acomplished in pypgsql? Thanks againg falks. Gerardo > 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/ > >