Re: [PATCH] plpythonu datatype conversion improvements - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: [PATCH] plpythonu datatype conversion improvements
Date
Msg-id 1252532735.4080.31.camel@hvost1700
Whole thread Raw
In response to Re: [PATCH] plpythonu datatype conversion improvements  (Caleb Welton <cwelton@greenplum.com>)
List pgsql-hackers
On Wed, 2009-05-27 at 14:25 -0700, Caleb Welton wrote:
> Yes, in Python >= 2.4 there is the Decimal datatype.  
> 
> However, unlike the other mappings employed by plpythonu, Decimal
> requires an import statement to be in scope.

adding it as already-imported module should not be hard 

I think that moving to saner mappings should at least be discussed

and even if it is not in scope for the user-defined function body there
is nothing that prevents one from using it for conversion.

The Decimal _type_ needs not to be in scope for using Decimal
_instances_

maybe this should/could be controlled by a GUC.



btw, can we currently use funtions in setting GUC parameters ?

if we can , then we could define some python environment initializing
function and then do

ALTER USER xxx SET pyinit = initialise_python_for_xxx()


> -Caleb
> 
> On 5/27/09 2:07 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> 
>         Peter Eisentraut <peter_e@gmx.net> writes:
>         > On Wednesday 27 May 2009 21:53:31 Caleb Welton wrote:
>         >> ... My own
>         >> feeling on the matter is that PyFloat is the wrong mapping
>         for numeric, but
>         >> I didn't want to muddy this patch by changing that.
>         
>         > Yeah, that one had me wondering for a while as well, but as
>         you say it is
>         > better to address that separately.
>         
>         That was making me itch as well, in my very cursory look at
>         the patch.
>         Does Python have a saner mapping for it?
>         
>                                 regards, tom lane
>         
-- 
Hannu Krosing   http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability   Services, Consulting and Training




pgsql-hackers by date:

Previous
From: decibel
Date:
Subject: Re: RfD: more powerful "any" types
Next
From: David Fetter
Date:
Subject: Bug in aggregates in windowing context