pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Implement regexp_match(), a simplified alternative to regexp_mat
Date: Wed, 17 Aug 2016 22:33:13 +0000
Message-ID: <E1ba9Ob-0008F5-TP@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Implement regexp_match(), a simplified alternative to regexp_matches().

regexp_match() is like regexp_matches(), but it disallows the 'g' flag
and in consequence does not need to return a set.  Instead, it returns
a simple text array value, or NULL if there's no match.  Previously people
usually got that behavior with a sub-select, but this way is considerably
more efficient.

Documentation adjusted so that regexp_match() is presented first and then
regexp_matches() is introduced as a more complicated version.  This is
a bit historically revisionist but seems pedagogically better.

Still TODO: extend contrib/citext to support this function.

Emre Hasegeli, reviewed by David Johnston

Discussion: <CAE2gYzy42sna2ME_e3y1KLQ-4UBrB-eVF0SWn8QG39sQSeVhEw@mail.gmail.com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/cf9b0fea5f6d1bcc9b2c66f5c30ecb04684a0919

Modified Files
--------------
doc/src/sgml/func.sgml                     | 155 ++++++++++++++++++++---------
src/backend/catalog/information_schema.sql |   2 +-
src/backend/utils/adt/regexp.c             | 137 +++++++++++++++++--------
src/include/catalog/catversion.h           |   2 +-
src/include/catalog/pg_proc.h              |   8 +-
src/include/utils/builtins.h               |   2 +
src/test/regress/expected/regex.out        |  28 ++++++
src/test/regress/expected/strings.out      |   4 +-
src/test/regress/sql/regex.sql             |   7 ++
9 files changed, 252 insertions(+), 93 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1ba9Ob-0008F5-TP@gemulon.postgresql.org>
Permalink:  ../E1ba9Ob-0008F5-TP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ba9Ob-0008F5-TP@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Implement regexp_match(), a simplified alternative to regexp_mat
  In-Reply-To: <E1ba9Ob-0008F5-TP@gemulon.postgresql.org>
  References: <E1ba9Ob-0008F5-TP@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox