Re: Standard REGEX functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vik Fearing <vik(at)postgresfriends(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Standard REGEX functions
Date: 2022-12-18 14:24:57
Message-ID: 252591.1671373497@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Vik Fearing <vik(at)postgresfriends(dot)org> writes:
> Are there any objections to me writing a patch to add SQL Standard
> regular expression functions even though they call for XQuery and we
> would use our own language?

Yes. If we provide spec-defined syntax it should have spec-defined
behavior. I really don't see the value of providing different
syntactic sugar for functionality we already have, unless the point
of it is to be spec-compliant, and what you suggest is exactly not
that.

I recall having looked at the points of inconsistency (see 9.7.3.8)
and thought that we could probably create an option flag for our regex
engine that would address them, or at least get pretty close. It'd
take some work though, especially for somebody who never looked at
that code before.

I'd be willing to blow off the locale discrepancies by continuing
to say that you have to use an appropriate locale, and I think the
business around varying newline representations is in the way-more-
trouble-than-its-worth department. But we should at least match
the spec on available escape sequences and flag names. It would
be a seriously bad idea, for example, if the default
does-dot-match-newline behavior wasn't per spec.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2022-12-18 14:42:39 Re: Error-safe user functions
Previous Message Vik Fearing 2022-12-18 13:59:56 Standard REGEX functions