Jim Nasby <Jim.Nasby@BlueTreble.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