Odd/undocumented precedence of concatenation operator

Поиск
Список
Период
Сортировка
От Shay Rojansky
Тема Odd/undocumented precedence of concatenation operator
Дата
Msg-id CADT4RqD-oBm5VRd+sxEFKaU9xcgH5-TmUq2-3G4QKonz+0VqTA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Odd/undocumented precedence of concatenation operator  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi hackers.

Trying to execute the following query on PostgreSQL 9.4.4:

select 'a' >= 'b' || 'c';

Gives the result "falsec", implying that the precedence of the string concatenation operator is lower than the comparison operator. Changing the >= into = provides the result false, which is less surprising.

Is this the expected behavior, considering that >= and = behave differently and that + ranks much higher?

If nothing else, it seems that the concatenation operator should be listed on the operator precedence table at http://www.postgresql.org/docs/9.4/static/sql-syntax-lexical.html#SQL-PRECEDENCE-TABLE?

Thanks!

Shay

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: psql tabcomplete - minor bugfix - tabcomplete for SET ROLE TO xxx
Следующее
От: "Shulgin, Oleksandr"
Дата:
Сообщение: Re: On-demand running query plans using auto_explain and signals