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

From Pavel Stehule
Subject Re: proposal: searching in array function - array_position
Date
Msg-id CAFj8pRBq-WmkpPbwXyM6i=zW_bk9TBfv+xKQgccv=YQSnpCyFg@mail.gmail.com
Whole thread Raw
In response to Re: proposal: searching in array function - array_position  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: proposal: searching in array function - array_position
List pgsql-hackers


2015-03-11 2:57 GMT+01:00 Robert Haas <robertmhaas@gmail.com>:
On Tue, Mar 10, 2015 at 5:53 PM, Jim Nasby <Jim.Nasby@bluetreble.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.

Pavel
 

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: In-core regression tests for replication, cascading, archiving, PITR, etc.
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: searching in array function - array_position