Re: [HACKERS] Proposal: generate_iterator functions

2008-03-24 Thread Bruce Momjian
I see you just submitted the patch so we will address it after the commit fest --- thanks. --- Pavel Stehule wrote: > done > > http://www.pgsql.cz/index.php/Iter%C3%A1tor_pole > > I'll send patch later > > Pavel > > 2007

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Pavel Stehule
done http://www.pgsql.cz/index.php/Iter%C3%A1tor_pole I'll send patch later Pavel 2007/10/18, Merlin Moncure <[EMAIL PROTECTED]>: > On 10/18/07, Tom Lane <[EMAIL PROTECTED]> wrote: > > "Merlin Moncure" <[EMAIL PROTECTED]> writes: > > > On 10/18/07, Tom Lane <[EMAIL PROTECTED]> wrote: > > >> On

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Merlin Moncure
On 10/18/07, Tom Lane <[EMAIL PROTECTED]> wrote: > "Merlin Moncure" <[EMAIL PROTECTED]> writes: > > On 10/18/07, Tom Lane <[EMAIL PROTECTED]> wrote: > >> On the question of being too long, I could live with > >> generate_subscripts(). > > > how about array_iota? > > I think a lot of people wouldn't

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Joe Conway
Tom Lane wrote: "Merlin Moncure" <[EMAIL PROTECTED]> writes: On 10/18/07, Tom Lane <[EMAIL PROTECTED]> 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

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > On 10/18/07, Tom Lane <[EMAIL PROTECTED]> wrote: >> On the question of being too long, I could live with >> generate_subscripts(). > how about array_iota? I think a lot of people wouldn't get the reference. How about array_subscripts()?

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Merlin Moncure
On 10/18/07, Tom Lane <[EMAIL PROTECTED]> wrote: > 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 direct

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > On 10/18/07, Tom Lane <[EMAIL PROTECTED]> 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 (arr

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Merlin Moncure
On 10/18/07, Tom Lane <[EMAIL PROTECTED]> wrote: > "Merlin Moncure" <[EMAIL PROTECTED]> writes: > > There was a very similar proposal a little while back (google: > > array_to_set). I think I like those names better since you are > > returning a set, not an iterator :-). > > I agree, this is a ver

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Pavel Stehule
2007/10/18, Tom Lane <[EMAIL PROTECTED]>: > "Merlin Moncure" <[EMAIL PROTECTED]> writes: > > There was a very similar proposal a little while back (google: > > array_to_set). I think I like those names better since you are > > returning a set, not an iterator :-). > > I agree, this is a very poor

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > There was a very similar proposal a little while back (google: > array_to_set). I think I like those names better since you are > returning a set, not an iterator :-). I agree, this is a very poor choice of name. There should be some reference to ar

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Pavel Stehule
2007/10/18, Merlin Moncure <[EMAIL PROTECTED]>: > On 10/18/07, Pavel Stehule <[EMAIL PROTECTED]> wrote: > > this function can help with array's iteration. > > > > create function generate_iterator(anyarray) > > returns setof integer > > as $$ > > select i > > from generate_series(array_lower($1,1

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Pavel Stehule
2007/10/18, Merlin Moncure <[EMAIL PROTECTED]>: > On 10/18/07, Pavel Stehule <[EMAIL PROTECTED]> wrote: > > this function can help with array's iteration. > > > > create function generate_iterator(anyarray) > > returns setof integer > > as $$ > > select i > > from generate_series(array_lower($1,1

Re: [HACKERS] Proposal: generate_iterator functions

2007-10-18 Thread Merlin Moncure
On 10/18/07, Pavel Stehule <[EMAIL PROTECTED]> wrote: > this function can help with array's iteration. > > create function generate_iterator(anyarray) > returns setof integer > as $$ > select i > from generate_series(array_lower($1,1), >array_upper($1,1)) g

[HACKERS] Proposal: generate_iterator functions

2007-10-17 Thread Pavel Stehule
Hello this function can help with array's iteration. create function generate_iterator(anyarray) returns setof integer as $$ select i from generate_series(array_lower($1,1), array_upper($1,1)) g(i) $$ language sql; -- multidimensional create function gene