From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> |
Cc: | Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Function accepting array of complex type |
Date: | 2015-08-28 20:55:52 |
Message-ID: | 32696.1440795352@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> writes:
> On 8/25/15 6:28 PM, Tom Lane wrote:
>> You need to cast it to some specific record type:
>> regression=# SELECT magsum( array[row(2.1, 2.1), row(2.2,2.2)]::c[] );
> Right, I was wondering how hard it would be to improve that, but it's
> not clear to me where to look at in the code. Does the resolution happen
> as part of parsing, or is it further down the road?
It would possibly make sense to allow coercion of record[] to
complex-array types, but there would be a lot of code to be written to
support it. See the unimplemented cases referencing RECORDARRAYOID in
parse_coerce.c, and compare to corresponding cases for coercing RECORDOID
to complex. (Note that the way array[...]::foo[] works is very specific
to ARRAY constructs, so it would not handle the general case. OTOH,
coerce_record_to_complex doesn't pretend to handle all cases either.)
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Nasby | 2015-08-28 21:01:44 | Re: proposal: multiple psql option -c |
Previous Message | David G. Johnston | 2015-08-28 20:31:28 | Re: proposal: multiple psql option -c |