Re: proposal: row_to_array function - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: proposal: row_to_array function
Date
Msg-id CAHyXU0xrk4FdxfAtFPwyKhtU+==aNyN-5sshEx6z7wLbEn_T8g@mail.gmail.com
Whole thread Raw
In response to Re: proposal: row_to_array function  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
On Tue, Jun 23, 2015 at 3:45 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
> On 6/23/15 3:22 PM, Merlin Moncure wrote:
>>
>> I would rephrase that to: "do X to all fields of an object".
>> Array handling is pretty good now (minus arrays of arrays, but arrays
>
>
> Except that still won't make it easy to do something to each element of an
> array in SQL, which I think would be nice to have.

Maybe, or maybe we're framing the problem incorrectly.  To me, it's
not really all that difficult to do:
select foo(x) from unnest(bar) x;

Unless you have to maintain state inside of foo(), in which case I'd
probably using the highly underutilized 'window over custom aggregate'
technique.

merlin



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: 9.5 release notes
Next
From: Tom Lane
Date:
Subject: Oh, this is embarrassing: init file logic is still broken