Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 900611337B7B for ; Fri, 29 Oct 2010 13:27:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 57485-01 for ; Fri, 29 Oct 2010 16:27:26 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 12EF01337B3E for ; Fri, 29 Oct 2010 13:27:26 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 1CDA2348017; Fri, 29 Oct 2010 09:27:25 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bs2hjB+lpbCT; Fri, 29 Oct 2010 09:27:22 -0700 (PDT) Received: from [192.168.1.100] (unknown [75.142.155.118]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 2C030348015; Fri, 29 Oct 2010 09:27:22 -0700 (PDT) Subject: Re: plpythonu: how to catch plpy.execute() exceptions From: "Joshua D. Drake" Reply-To: jd@commandprompt.com To: Tom Lane Cc: Dragos Valentin Moinescu , pgsql-admin@postgresql.org In-Reply-To: <671.1288361031@sss.pgh.pa.us> References: <671.1288361031@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Organization: Command Prompt, Inc. Date: Fri, 29 Oct 2010 09:27:21 -0700 Message-ID: <1288369641.2355.17.camel@jd-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201010/213 X-Sequence-Number: 35954 On Fri, 2010-10-29 at 10:03 -0400, Tom Lane wrote: > Dragos Valentin Moinescu writes: > > The thing is that I cannot catch the exception raised by plpy.execute(). > > Yeah, plpython's error handling is fundamentally broken. Somebody > needs to rewrite it to be more like the other PLs. In the meantime, > I'd suggest using plperl, which has gotten a lot more love than > plpython ever did. Or take a look at pg-python: http://pgfoundry.org/projects/python/ Which is much more actively maintained and still Python. JD -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579 Consulting, Training, Support, Custom Development, Engineering http://twitter.com/cmdpromptinc | http://identi.ca/commandprompt