Re: proposal: searching in array function - array_position

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Marko Tiikkaja <marko(at)joh(dot)to>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: proposal: searching in array function - array_position
Date: 2015-03-20 16:49:29
Message-ID: CAEZATCXHb+tv8YYo4=XRoBzCOywTrM4cncqR57D4ZM7WdFomiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 18 March 2015 at 19:03, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
> Pushed after adding error checks there and fixing the docs to match.
> Please verify.
>

There's an issue when the array's lower bound isn't 1:

select array_offset('[2:4]={1,2,3}'::int[], 1);
array_offset
--------------
1
(1 row)

whereas I would expect this to return 2. Similarly for
array_offsets(), so the offsets can be used as indexes into the
original array.

Regards,
Dean

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2015-03-20 16:52:35 Remove fsync ON/OFF as a visible option?
Previous Message David G. Johnston 2015-03-20 16:10:11 Re: [PATCH] two-arg current_setting() with fallback