Re: proposal: searching in array function - array_position

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: searching in array function - array_position
Date: 2015-03-11 20:18:12
Message-ID: 5500A304.9000706@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/11/15 1:19 AM, Pavel Stehule wrote:
> 2015-03-11 2:57 GMT+01:00 Robert Haas <robertmhaas(at)gmail(dot)com
> <mailto:robertmhaas(at)gmail(dot)com>>:
>
> On Tue, Mar 10, 2015 at 5:53 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com
> <mailto:Jim(dot)Nasby(at)bluetreble(dot)com>> wrote:
> > I don't think we need both array_offset and array_offset_start; can't both
> > SQL functions just call one C function?
>
> Not if you want the opr_sanity tests to pass.
>
> (But I'm seriously starting to wonder if that's actually a smart rule
> for us to be enforcing. It seems to be something of a pain in the
> neck, and I'm unclear as to whether it is preventing any real
> problem.)
>
>
> It is simple protection against some oversights. I am not against this
> check - this rule cleans a interface between C and SQL. More, the
> additional C code is usually very short and trivial.
>
> But it should be commented well.

Ahh, ok, makes more sense now. If the separate C functions are serving a
purpose that's fine. I think the comment should mention it though, as
it's not exactly the most obvious thing.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2015-03-11 20:36:18 Re: Precedence of standard comparison operators
Previous Message Greg Stark 2015-03-11 20:12:46 Re: Precedence of standard comparison operators