Re: SQL-spec incompatibilities in similar_escape() and related stuff

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: SQL-spec incompatibilities in similar_escape() and related stuff
Date: 2019-05-23 22:10:24
Message-ID: 32617.1558649424@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I propose therefore that we leave similar_escape in place with its
> current behavior, as a compatibility measure for cases like this.
> Intead, invent two new strict functions, say
> similar_to_escape(pattern)
> similar_to_escape(pattern, escape)
> and change the parser and the implementation of SUBSTRING() to
> rely on these going forward.

> The net effect will be to make explicit "ESCAPE NULL" spec-compliant,
> and to get rid of the performance problem from inlining failure for
> substring(). All else is just doc clarifications.

Here's a proposed patch for that. I think it's a bit too late to be
messing with this kind of thing for v12, so I'll add this to the
upcoming CF.

regards, tom lane

Attachment Content-Type Size
make-similar-to-escape-null-handling-sane.patch text/x-diff 12.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-05-23 22:16:55 Re: Remove useless associativity/precedence from parsers
Previous Message Donald Dong 2019-05-23 20:15:02 Re: Why could GEQO produce plans with lower costs than the standard_join_search?