Re: Define jsonpath functions as stable

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Define jsonpath functions as stable
Date: 2019-09-16 23:11:13
Message-ID: 5D801691.3060805@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/16/19 17:10, Tom Lane wrote:

> I was initially troubled
> by the fact that XML Schema regexps are implicitly anchored, ie must
> match the whole string; that's a huge difference from POSIX. However,
> 19075-6 says that jsonpath like_regex works the same as the LIKE_REGEX
> predicate in SQL; and SQL:2011 "9.18 XQuery regular expression matching"
> defines LIKE_REGEX to work exactly like XQuery's fn:matches function,
> except for some weirdness around newline matching; and that spec
> clearly says that fn:matches treats its pattern argument as NOT anchored.

Yeah, it's a layer cake. XML Schema regexps[1] are implicitly anchored and
don't have any metacharacters devoted to anchoring.

XQuery regexps layer onto[2] XML Schema regexps, adding ^ and $ anchors,
rescinding the implicit anchored-ness, adding reluctant quantifiers,
capturing groups, and back-references, and defining flags.

Then ISO SQL adds a third layer changing the newline semantics, affecting
^, $, ., \s, and \S.

Regards,
-Chap

[1] https://www.w3.org/TR/xmlschema-2/#regexs
[2] https://www.w3.org/TR/xpath-functions-31/#regex-syntax

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-09-16 23:13:39 Nondeterministic collations vs. text_pattern_ops
Previous Message Jonathan S. Katz 2019-09-16 22:39:40 Re: Define jsonpath functions as stable