Re: exceptions not present in plpy with Python 3 - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: exceptions not present in plpy with Python 3
Date
Msg-id 1295646577.8026.0.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: exceptions not present in plpy with Python 3  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On tor, 2011-01-20 at 22:30 +0200, Peter Eisentraut wrote:
> On lör, 2010-12-18 at 18:56 +0100, Jan Urbański wrote:
> > there seems to be a problem in the way we add exceptions to the plpy
> > module in PL/Python compiled with Python 3k.
> > 
> > Try this: DO $$ plpy.SPIError $$ language plpython3u;
> > 
> > I'm not a Python 3 expert, but I nicked some code from the Internet and
> > came up with this patch (passes regression tests on both Python 2 and 3).
> 
> It looks like the PyModule_AddObject() approach also works in Python 2.
> Anyone see an issue with using that uniformly?

Committed using PyModule_AddObject.



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: WIP: RangeTypes
Next
From: Pavel Stehule
Date:
Subject: Re: REVIEW: WIP: plpgsql - foreach in