pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chapman Flack <chap@anastigmatix.net>
To: Gilles Darold <gilles@darold.net>
To: er@xs4all.nl
To: pgsql-hackers@lists.postgresql.org
Subject: Re: [PATCH] proposal for regexp_count, regexp_instr, regexp_substr and regexp_replace
Date: Sun, 21 Mar 2021 10:42:34 -0400
Message-ID: <60575B5A.4080807@anastigmatix.net> (raw)
In-Reply-To: <9f91e4e7-19c8-d8e0-6955-fefaebd4c8fe@darold.net>
References: <fc160ee0-c843-b024-29bb-97b5da61971f@darold.net>
	<2292303d-766d-2172-2942-b076a3bb6505@darold.net>
	<2122577845.234888.1616324857283@webmailclassic.xs4all.nl>
	<9f91e4e7-19c8-d8e0-6955-fefaebd4c8fe@darold.net>

On 03/21/21 09:19, Gilles Darold wrote:
>>> On 2021.03.20. 19:48 Gilles Darold <gilles@darold.net> wrote:
>>>  
>>> This is a new version of the patch that now implements all the XQUERY
>>> regexp functions as described in the standard, minus the differences of
>>> PostgerSQL regular expression explain in [1].
>>>
>>> The standard SQL describe functions like_regex(), occurrences_regex(),
>>> position_regex(), substring_regex() and translate_regex() which
>>> correspond to the commonly named functions regexp_like(),
>>> regexp_count(), regexp_instr(), regexp_substr() and regexp_replace() as
>>> reported by Chapman Flack in [2]. All these function are implemented in
>>> [v2-0001-xquery-regexp-functions.patch]

I quickly looked over this patch preparing to object if it actually
purported to implement the ISO foo_regex() named functions without
the ISO semantics, but a quick grep reassured me that it doesn't
implement any of those functions. It only supplies functions in
the alternative, apparently common de facto naming scheme regexp_foo().

To be clear, I think that's the right call. I do not think it would be
a good idea to supply functions that have the ISO names but not the
specified regex dialect.

A set of functions analogous to the ISO ones but differently named and
with a different regex dialect seems fine to me, especially if these
different names are de facto common, and as far as I can tell, that is
what this patch provides. So I have no objection to that. :)

It might then be fair to say that the /description/ of the patch as
implementing the XQuery-based foo_regex functions isn't quite right,
or at least carries a risk of jarring some readers into hasty
double-takes on Sunday mornings before coffee.

It might be clearer to just mention the close correspondence between
the functions in this differently-named set and the corresponding ISO ones.

If this turns out to be a case of "attached the wrong patch, here's
the one that does implement foo_regex functions!" then I reserve an
objection to that. :)

Regards,
-Chap





view thread (28+ messages)  latest in thread

Message-ID: <60575B5A.4080807@anastigmatix.net>
Permalink:  ../60575B5A.4080807@anastigmatix.net/
Also on:    postgresql.org/message-id/60575B5A.4080807@anastigmatix.net

 · 

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-hackers@postgresql.org
  Cc: chap@anastigmatix.net, gilles@darold.net, er@xs4all.nl
  Subject: Re: [PATCH] proposal for regexp_count, regexp_instr, regexp_substr and regexp_replace
  In-Reply-To: <60575B5A.4080807@anastigmatix.net>
  References: <fc160ee0-c843-b024-29bb-97b5da61971f@darold.net> <2292303d-766d-2172-2942-b076a3bb6505@darold.net> <2122577845.234888.1616324857283@webmailclassic.xs4all.nl> <9f91e4e7-19c8-d8e0-6955-fefaebd4c8fe@darold.net> <60575B5A.4080807@anastigmatix.net>

* 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