Re: BUG #15084: Invalid LIKE pattern not always reported
От | David G. Johnston |
---|---|
Тема | Re: BUG #15084: Invalid LIKE pattern not always reported |
Дата | |
Msg-id | CAKFQuwbBwjn5KeDOYm-6_uOn_WWyj0ptsGLO-kqVtiei2h6AAw@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #15084: Invalid LIKE pattern not always reported (PG Bug reporting form <noreply@postgresql.org>) |
Список | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 15084
Logged by: Tudor Bosman
Email address: tudorb@gmail.com
PostgreSQL version: 9.5.11
Operating system: Ubuntu 16.04
Description:
PostgreSQL will not always detect an invalid LIKE pattern (one that ends
with a backslash).
Example:
tudor=# select 'foo' like 'foo\';
?column?
----------
f
(1 row)
tudor=# select 'foobar' like 'foo\';
ERROR: LIKE pattern must not end with escape character
This probably happens because the pattern is only parsed lazily (as needed);
if PostgreSQL detects that a match is impossible, it doesn't even look at
the rest of the pattern.
Still, it would be nice for error reporting to be consistent.
Last March (Bug# 14512) Tom Lane thought a performant solution was possible though it was never committed.
I'm still +1 if it can be done without hurting performance on patterns that do match - a compile-time failure here is desirable.
Full thread here:
David J.
В списке pgsql-bugs по дате отправления: