-
- Downloads
Change array_offset to return subscripts, not offsets
... 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.
Showing
- doc/src/sgml/array.sgml 9 additions, 9 deletionsdoc/src/sgml/array.sgml
- doc/src/sgml/func.sgml 11 additions, 11 deletionsdoc/src/sgml/func.sgml
- src/backend/utils/adt/array_userfuncs.c 29 additions, 25 deletionssrc/backend/utils/adt/array_userfuncs.c
- src/include/catalog/catversion.h 1 addition, 1 deletionsrc/include/catalog/catversion.h
- src/include/catalog/pg_proc.h 3 additions, 3 deletionssrc/include/catalog/pg_proc.h
- src/include/utils/array.h 3 additions, 3 deletionssrc/include/utils/array.h
- src/test/regress/expected/arrays.out 60 additions, 48 deletionssrc/test/regress/expected/arrays.out
- src/test/regress/sql/arrays.sql 21 additions, 18 deletionssrc/test/regress/sql/arrays.sql
Loading
Please register or sign in to comment