Re: BUG #3822: Nonstandard precedence for comparison operators
| От | Michael Glaesemann |
|---|---|
| Тема | Re: BUG #3822: Nonstandard precedence for comparison operators |
| Дата | |
| Msg-id | F7FD54CC-6091-4F99-AF53-BBD4B13ABF5F@seespotcode.net обсуждение |
| Ответ на | Re: BUG #3822: Nonstandard precedence for comparison operators (Pedro Gimeno <pgsql-001@personal.formauri.es>) |
| Ответы |
Re: BUG #3822: Nonstandard precedence for comparison operators
|
| Список | pgsql-bugs |
On Dec 29, 2007, at 14:09 , Pedro Gimeno wrote:
> variants of which I think can be
> relatively common compared to e.g. applications that build a boolean
> array using expr1 <> expr2 || boolean_value.
I'm probably being dense, but I don't see how this is an issue. || is
string concatenation, not a logical OR. You're going to throw an
error because || isn't a boolean operator, not because of any strange
precedence rules.
test=# select 1 <> 2 || true;
ERROR: operator does not exist: boolean || boolean
LINE 1: select 1 <> 2 || true;
^
HINT: No operator matches the given name and argument type(s). You
may need to add explicit type casts.
test=# select 'foo'::text <> 'bar'::text || true;
ERROR: operator does not exist: boolean || boolean
LINE 1: select 'foo'::text <> 'bar'::text || true;
^
HINT: No operator matches the given name and argument type(s). You
may need to add explicit type casts.
Michael Glaesemann
grzm seespotcode net
В списке pgsql-bugs по дате отправления: