Re: proposal: searching in array function - array_position

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: proposal: searching in array function - array_position
Дата
Msg-id CAFj8pRCYak+N7E83F2SR9dTi0QrXBbSkezqkLzo=b9-2phRqsg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: searching in array function - array_position  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Ответы Re: proposal: searching in array function - array_position  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers


2015-03-21 0:27 GMT+01:00 Jim Nasby <Jim.Nasby@bluetreble.com>:
On 3/20/15 2:48 PM, Pavel Stehule wrote:


2015-03-20 18:47 GMT+01:00 Tom Lane <tgl@sss.pgh.pa.us
<mailto:tgl@sss.pgh.pa.us>>:

    Alvaro Herrera <alvherre@2ndquadrant.com
    <mailto:alvherre@2ndquadrant.com>> writes:
    > Pavel Stehule wrote:
    >> I am thinking, so it is ok - it returns a offset, not position.

    > So you can't use it as a subscript?  That sounds unfriendly.  Almost
    > every function using this will be subtly broken.

    I concur; perhaps "offset" was the design intention, but it's wrong.
    The result should be a subscript.


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.

additional implementation of array_position needs few lines more
 

On another note, you mentioned elsewhere that it's not possible to return anything other than an integer. Why can't there be a variation of this function that returns an array of ndims-1 that is the slice where a value was found?

We talked about it, when we talked about MD searching - and we moved it to next stage.

I am thinking so array_postions can support MD arrays due returning a array

Regards

Pavel

 

--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Remove fsync ON/OFF as a visible option?
Следующее
От: Jaime Casanova
Дата:
Сообщение: Re: Remove fsync ON/OFF as a visible option?