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