Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: BUG #3822: Nonstandard precedence for comparison operators




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





Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group