Search Postgresql Archives

Re: obtaining ARRAY position for a given match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 19, 2009 at 12:15 PM, Scott Bailey <artacus@xxxxxxxxxxx> wrote:
>>   FROM generate_series(array_lover($1,1),array_upper($1,1)) g(i)
>
> Pavel,
>
> Don't get me wrong, I enjoy coding, but I think you've taken it too far here
> ;)
>
> Yes, definitely more effective for large arrays. Thanks. Would probably be a
> good snippet for the wiki.

this was actually a pretty typical solution to dealing with arrays
until we got 'unnest()'.  See information_schema._pg_expand_array for
example.

I need this functionality quite often...maybe we could use a version
of unnest that works like that  (returns idx, elem)?  It would be a
small efficiency win over generate_series based approaches.

merlin

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux