Re: BUG #14512: Backslashes in LIKE

From: Vojtěch Rylko <vojta(dot)rylko(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14512: Backslashes in LIKE
Date: 2017-01-25 09:16:58
Message-ID: CA+fsJpGX1UaPQOwDxQqh2y4NZAzgEL77oQtKnPcTXZUWLuRaEg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

2017-01-24 19:15 GMT+01:00 David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>:
>
> Then consider a feature request that a malformed pattern be detected and fail independent of the data being checked. Such non-deterministic failure is at least a POLA violation and makes what should be a basically compile-time error into a run-time one.

This is not pure compile-time "error" as pattern in LIKE could be
dynamic expression, for example:

root=# create table t (a varchar);
CREATE TABLE

root=# insert into t values ('\\\');
INSERT 0 1

root=# select * from t t1 cross join t t2 where t1.a like t2.a;
ERROR: LIKE pattern must not end with escape character

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Vojtěch Rylko 2017-01-25 09:28:25 Re: BUG #14512: Backslashes in LIKE
Previous Message reva.d91 2017-01-25 07:23:11 BUG #14514: Bug in Subquery