Re: plpython transforms vs. arrays - Mailing list pgsql-sql

From Tom Lane
Subject Re: plpython transforms vs. arrays
Date
Msg-id 12205.1556852174@sss.pgh.pa.us
Whole thread Raw
In response to  (Mark Teper <mark.teper@gmail.com>)
List pgsql-sql
Mark Teper <mark.teper@gmail.com> writes:
> The problem is this produces an error that transforms for type "real"
> doesn't work.  It doesn't seem to allow for transforms on array's as
> opposed to underlying types.  Is it possible to tell it to apply the
> transform to the array?

Yeah, see PLy_input_setup_func and PLy_output_setup_func, which both
say

     * Choose conversion method.  Note that transform functions are checked
     * for composite and scalar types, but not for arrays or domains.  This is
     * somewhat historical, but we'd have a problem allowing them on domains,
     * since we drill down through all levels of a domain nest without looking
     * at the intermediate levels at all.

At least for arrays, it might be sufficient to switch the order of the
array-lookup and transform-lookup cases to fix this.  I don't think
anyone's felt motivated to look into that, up to now.

            regards, tom lane



pgsql-sql by date:

Previous
From: Mark Teper
Date:
Subject:
Next
From: Jiří Fejfar
Date:
Subject: Re: plpython transforms vs. arrays