Re: proposal: searching in array function - array_position - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: proposal: searching in array function - array_position
Date
Msg-id CAEZATCVukO8LcYTjceH=NZzcmicPg-phg53kzuRiJS33_vhUDg@mail.gmail.com
Whole thread Raw
In response to Re: proposal: searching in array function - array_position  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
>>> do you have any idea about name for this function? array_position is ok?
>>
>> +1 on array_position. It's possible at some point we'll actually want
>> array_offset that does what it claims.
>

+1 for array_position.

-1 for keeping array_offset. I'm not convinced that there are
sufficient use cases for it. No other array functions deal in offsets
relative to the first element, and if you do want that, it is trivial
to achieve with array_position() and array_lower(). IMO having 2
functions for searching in an array will just increase the risk of
users picking the wrong one by accident.

Regards,
Dean



pgsql-hackers by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Remove fsync ON/OFF as a visible option?
Next
From: Fabien COELHO
Date:
Subject: Re: PATCH: pgbench - merging transaction logs