Re: update substring pattern matching syntax

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: update substring pattern matching syntax
Date: 2020-06-19 22:03:31
Message-ID: 2a525de8-0e4d-1483-5033-58902edd287e@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/19/20 11:42 AM, Peter Eisentraut wrote:
> At
> <https://wiki.postgresql.org/wiki/PostgreSQL_vs_SQL_Standard#Obsolete_syntax_for_substring.28.29>
> it is described that the substring pattern matching syntax in PostgreSQL
> does not conform to the current standard.  PostgreSQL implements
>
>     SUBSTRING(text FROM pattern FOR escapechar)
>
> whereas the current standard says
>
>     SUBSTRING(text SIMILAR pattern ESCAPE escapechar)
>
> The former was in SQL99, but the latter has been there since SQL:2003.
>
> It's pretty easy to implement the second form also, so here is a patch
> that does that.

Oh good, this was on my list (I added that item to the wiki).

The patches look straightforward to me. The grammar cleanup patch makes
things easier to read indeed. At first I didn't see a test left over
for the old syntax, but it's there so this is all LGTM.

Thanks for doing this!
--
Vik Fearing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-06-19 22:23:59 Re: Review for GetWALAvailability()
Previous Message Thomas Munro 2020-06-19 21:33:26 Re: pg_regress cleans up tablespace twice.