Обсуждение: Odd "operator does not exist" message

Поиск
Список
Период
Сортировка

Odd "operator does not exist" message

От
"David G. Johnston"
Дата:
Stumbled across this and it just seemed unusual - though by no means
cryptic.

SELECT 'text' || AS label

ERROR:  operator does not exist: unknown ||

The lack of a second type to the right of the operator symbol caught my
attention.

SELECT 1 + AS label

ERROR: syntax error at or near "AS"

Was seemingly what I had been expecting...

David J.

Re: Odd "operator does not exist" message

От
Tom Lane
Дата:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Stumbled across this and it just seemed unusual - though by no means
> cryptic.

> SELECT 'text' || AS label
> ERROR:  operator does not exist: unknown ||
> The lack of a second type to the right of the operator symbol caught my
> attention.
> SELECT 1 + AS label
> ERROR: syntax error at or near "AS"
> Was seemingly what I had been expecting...

|| is allowed as a postfix operator, + is not ...

            regards, tom lane