postgresql/src
Tom Lane ec0294fb2c Support negative indexes in split_part().
This provides a handy way to get, say, the last field of the string.
Use of a negative index in this way has precedent in the nearby
left() and right() functions.

The implementation scans the string twice when N < -1, but it seems
likely that N = -1 will be the huge majority of actual use cases,
so I'm not really excited about adding complexity to avoid that.

Nikhil Benesch, reviewed by Jacob Champion; cosmetic tweakage by me

Discussion: https://postgr.es/m/cbb7f861-6162-3a51-9823-97bc3aa0b638@gmail.com
2020-11-13 13:49:48 -05:00
..
backend Support negative indexes in split_part(). 2020-11-13 13:49:48 -05:00
bin Remove another test that doesn't work on Windows. 2020-11-13 13:41:58 +02:00
common Fix minor issues with new unicode {de,re}composition code 2020-11-07 10:15:58 +09:00
fe_utils Remove incorrect %s in string 2020-11-09 10:38:22 +01:00
include Add pg_nodiscard decorations to some functions 2020-11-11 11:00:27 +01:00
interfaces Fix some stray whitespace in parser files 2020-11-11 17:37:18 +01:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Don't use custom OID symbols in pg_type.dat, either. 2020-10-29 13:33:38 -04:00
port Add pg_strong_random_init function to initialize random number generator 2020-11-06 13:21:28 +01:00
template Makefile comment: remove reference to tools/thread/thread_test 2020-10-27 14:00:50 -04:00
test Support negative indexes in split_part(). 2020-11-13 13:49:48 -05:00
timezone Update time zone data files to tzdata release 2020d. 2020-10-22 21:23:47 -04:00
tools Remove line missed in previous commit 2020-11-11 16:51:36 +01:00
tutorial Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00