Re: BUG #15084: Invalid LIKE pattern not always reported

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15084: Invalid LIKE pattern not always reported
Дата
Msg-id 23731.1519419101@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #15084: Invalid LIKE pattern not always reported  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> PostgreSQL will not always detect an invalid LIKE pattern (one that ends
> with a backslash).
> 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.

Yeah, exactly.

> Still, it would be nice for error reporting to be consistent.

This has been discussed before, but nobody could see how to do it without
taking a performance hit (ie, doing a full scan of the pattern before
doing any actual work).  It didn't seem worth that.

It occurs to me that we could make the behavior more consistent by
redefining a trailing backslash as something we silently ignore, instead
of raising an error.  Not sure if that's an improvement, though.

            regards, tom lane


В списке pgsql-bugs по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #15084: Invalid LIKE pattern not always reported
Следующее
От: David Gould
Дата:
Сообщение: Re: maximum for auto_explain.log_min_duration doesn't seem to makesense