agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Teper <mark.teper@gmail.com>
Cc: pgsql-sql@lists.postgresql.org
Subject: Re: plpython transforms vs. arrays
Date: Thu, 02 May 2019 22:56:14 -0400
Message-ID: <12205.1556852174@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMwSyGra+i1oL0pKgCv1WeE6GeBNhJJZTJ0bGxLNqJ0SFeEsVw@mail.gmail.com>
References: <CAMwSyGra+i1oL0pKgCv1WeE6GeBNhJJZTJ0bGxLNqJ0SFeEsVw@mail.gmail.com>
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
view thread (3+ messages) latest in thread
Message-ID: <12205.1556852174@sss.pgh.pa.us>
Permalink: ../12205.1556852174@sss.pgh.pa.us/
Also on: postgresql.org/message-id/12205.1556852174@sss.pgh.pa.us
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, mark.teper@gmail.com, pgsql-sql@lists.postgresql.org
Subject: Re: plpython transforms vs. arrays
In-Reply-To: <12205.1556852174@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox