looking for an 'array_index' function?

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: looking for an 'array_index' function?
Date: 2004-03-19 15:19:11
Message-ID: Pine.LNX.4.58.0403191610350.15910@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Dear hackers,

I'm looking for an array_index function that would return the index of the
occurence of some element in an array. I noticed that I can know whether a
element is in the array with ANY, but I also need the actual index.

There is no such function under that name, and I cannot find any that
would do the job in the doc. I made a quick workaround in plpgsql, but I
would have expected the function to be there.

Am I unlucky or just blind?

I know that looking for such a function is a proof a bad design, but I
don't feel responsible for the pg_catalog.* design;-)

Thanks in advance for any pointer,

Have a nice day,

--
Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-19 15:21:21 Re: COPY formatting
Previous Message Andrew Dunstan 2004-03-19 15:18:26 Re: COPY formatting