Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results
Дата
Msg-id 16085.1356106091@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results  (Denis Papathanasiou <denis.papathanasiou@banrai.com>)
Список pgsql-general
Denis Papathanasiou <denis.papathanasiou@banrai.com> writes:
> I did realize that ANY() must be a right-hand operator, but what I
> didn't understand (and admittedly still don't understand) is why regex
> operations that are normally right-side work from the left.

All regex operators in Postgres have the pattern on the right.  This
follows the lead of the SQL standard's LIKE operator, which has its
pattern on the right.  You might be used to some other language that
puts the pattern on the left, but that isn't some kind of natural law.
And it most certainly isn't the case that the operator will look at the
two text strings and try to guess which one is meant as a pattern.  That
would be impossibly unreliable.

> If you look at the four examples which follow the posix match table in
> the docs
> (http://www.postgresql.org/docs/9.1/static/functions-matching.html#FUNCTIONS-POSIX-TABLE),
> some of them work from the left side, e.g.:

Not to my eyes ...

            regards, tom lane


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

Предыдущее
От: "David Johnston"
Дата:
Сообщение: Re: Using POSIX Regular Expressions on xml type fields gives inconsistent results
Следующее
От: Chris Angelico
Дата:
Сообщение: Re: Coalesce bug ?