Re: BUG #3822: Nonstandard precedence for comparison operators

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Pedro Gimeno <pgsql-001(at)personal(dot)formauri(dot)es>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3822: Nonstandard precedence for comparison operators
Date: 2007-12-29 19:26:17
Message-ID: F7FD54CC-6091-4F99-AF53-BBD4B13ABF5F@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-12-29 19:59:32 Re: BUG #3822: Nonstandard precedence for comparison operators
Previous Message Pedro Gimeno 2007-12-29 19:09:01 Re: BUG #3822: Nonstandard precedence for comparison operators