Re: plpython transforms vs. arrays

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Teper <mark(dot)teper(at)gmail(dot)com>
Cc: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: plpython transforms vs. arrays
Date: 2019-05-03 02:56:14
Message-ID: 12205.1556852174@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mark Teper <mark(dot)teper(at)gmail(dot)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

In response to

  • at 2019-05-02 17:51:22 from Mark Teper

Browse pgsql-sql by date

  From Date Subject
Next Message Jiří Fejfar 2019-05-03 04:53:43 Re: plpython transforms vs. arrays
Previous Message Mark Teper 2019-05-02 17:51:22