From 97690ea6e86c412461dd5dc99953b829564d1a55 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Mon, 30 Mar 2015 16:13:21 -0300 Subject: Change array_offset to return subscripts, not offsets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... and rename it and its sibling array_offsets to array_position and array_positions, to account for the changed behavior. Having the functions return subscripts better matches existing practice, and is better suited to using the result value as a subscript into the array directly. For one-based arrays, the new definition is identical to what was originally committed. (We use the term "subscript" in the documentation, which is what we use whenever we talk about arrays; but the functions themselves are named using the word "position" to match the standard-defined POSITION() functions.) Author: Pavel Stěhule Behavioral problem noted by Dean Rasheed. --- src/include/utils/array.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/include/utils/array.h') diff --git a/src/include/utils/array.h b/src/include/utils/array.h index b78b42abddd..0a488e7b0c1 100644 --- a/src/include/utils/array.h +++ b/src/include/utils/array.h @@ -358,9 +358,9 @@ extern Datum array_agg_finalfn(PG_FUNCTION_ARGS); extern Datum array_agg_array_transfn(PG_FUNCTION_ARGS); extern Datum array_agg_array_finalfn(PG_FUNCTION_ARGS); -extern Datum array_offset(PG_FUNCTION_ARGS); -extern Datum array_offset_start(PG_FUNCTION_ARGS); -extern Datum array_offsets(PG_FUNCTION_ARGS); +extern Datum array_position(PG_FUNCTION_ARGS); +extern Datum array_position_start(PG_FUNCTION_ARGS); +extern Datum array_positions(PG_FUNCTION_ARGS); /* * prototypes for functions defined in array_typanalyze.c -- cgit v1.2.3