Re: [BUGS] BUG #14512: Backslashes in LIKE - Mailing list pgsql-bugs

From Vojtěch Rylko
Subject Re: [BUGS] BUG #14512: Backslashes in LIKE
Date
Msg-id CA+fsJpGX1UaPQOwDxQqh2y4NZAzgEL77oQtKnPcTXZUWLuRaEg@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14512: Backslashes in LIKE  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: [BUGS] BUG #14512: Backslashes in LIKE  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
2017-01-24 19:15 GMT+01:00 David G. Johnston <david.g.johnston@gmail.com>:
>
> Then consider a feature request that a malformed pattern be detected and fail independent of the data being checked.
Suchnon-deterministic failure is at least a POLA violation and makes what should be a basically compile-time error into
arun-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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: reva.d91@gmail.com
Date:
Subject: [BUGS] BUG #14514: Bug in Subquery
Next
From: Vojtěch Rylko
Date:
Subject: Re: [BUGS] BUG #14512: Backslashes in LIKE