| From: | Joe Conway <mail(at)joeconway(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Merlin Moncure <mmoncure(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Proposal: generate_iterator functions |
| Date: | 2007-10-18 19:20:16 |
| Message-ID: | 4717B1F0.4040707@joeconway.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Tom Lane wrote:
> "Merlin Moncure" <mmoncure(at)gmail(dot)com> writes:
>> On 10/18/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> generate_array_subscripts() maybe?
>
>> array_to_set or array_expand seem a little better imo (shorter, and
>> symmetry with array_accum()), unless you want to differentiate between
>> internal funcs (array_cat and the like) vs. user funcs.
>
> I don't much like either of those, because they seem misleading:
> what I'd expect from a function named that way is that it returns
> the *elements* of the array, not their subscripts.
>
> Come to think of it, do we have a way of doing that directly? If you
> only care about accessing the array elements, it seems like dealing in
> the subscripts is just notational tedium. Perhaps there should be
> array_expand(anyarray) returns setof anyelement, in addition to the
> subscript generation function.
I think what you're describing is the SQL2003 UNNEST feature.
Joe
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Alvaro Herrera | 2007-10-18 19:24:48 | Re: upgrade from 8.0.3 to 8.1.10 crash |
| Previous Message | Tom Lane | 2007-10-18 19:20:02 | Re: Proposal: generate_iterator functions |