Re: pgsql: Fix for plpython functions; return true/false for boolean, - Mailing list pgsql-hackers

From Tino Wildenhain
Subject Re: pgsql: Fix for plpython functions; return true/false for boolean,
Date
Msg-id 45C0A0A7.3030406@wildenhain.de
Whole thread Raw
In response to Re: pgsql: Fix for plpython functions; return true/false for boolean,  (Bruce Momjian <bruce@momjian.us>)
Responses Re: pgsql: Fix for plpython functions; return true/false for boolean,
Re: pgsql: Fix for plpython functions; return true/false for boolean,
List pgsql-hackers
Bruce Momjian schrieb:
> Hannu Krosing wrote:
>> Officially by who ?
>>
>> 2.3 was the first version to introduce bool as a subtype of int, in
>> 2.2.3 True and False were introduced as two variables pointing to
>> integers 1 and 0.
>>
>> So to make your patch ok on all python versions, just make it
>> conditional on python version being 2.3 or bigger, and return int for
>> pre-2.3.
>
> I thought about suggesting that, but do we want plpython to have
> different result behavior based on the version of python used?  I didn't
> think so.

Why not? Python2.2 is rarely in use anymore and users of this would get
the same behavior. Users of python2.3 and up would get the additionally
cleaned boolean interface - also users which go the from __future__
import ... way. Thats how python works and develops forth and we should
not work against that from postgres side.

So I'm indeed +1 for conditional approach.

Regards
Tino

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pgsql: Fix for plpython functions; return true/false for boolean,
Next
From: Bruce Momjian
Date:
Subject: Re: pgsql: Fix for plpython functions; return true/false for boolean,