Re: BUG #3822: Nonstandard precedence for comparison operators

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Pedro Gimeno" <pgsql-001(at)personal(dot)formauri(dot)es>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #3822: Nonstandard precedence for comparison operators
Date: 2007-12-27 21:25:30
Message-ID: 4773C3E9.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>>> On Mon, Dec 17, 2007 at 1:58 PM, in message
<200712171958(dot)lBHJwOBb037317(at)wwwmaster(dot)postgresql(dot)org>, "Pedro Gimeno"
<pgsql-001(at)personal(dot)formauri(dot)es> wrote:

> Description: Nonstandard precedence for comparison operators

> The operators <>, <= and >= are expected to have the same precedence as =, <
> and >, but according to the docs (and matching actual behaviour) they have
> the same precedence as e.g. ||.
>
> This leads to surprises

> Of course the same applies to != since it is converted to <>.
>
> Now being picky, the precedence of < and > should be the same as that of =
> (for comparison, not for assignment), which makes a difference in rare cases

Everything Pedro said in this post matched my understanding of the
SQL specification. I went back and read those sections closely,
and I can't find any basis for interpreting the spec any other way.
This seems like a pretty serious point of non-compliance to me.

That said, bringing PostgreSQL into compliance with the standard
would undoubtedly break some people's existing applications. It
seems to call for the same phased approach as the standard
conforming string literals, with GUCs to control warnings for
problem constructs and legacy versus standard runtime behavior.

-Kevin

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-12-27 22:22:10 Re: BUG #3822: Nonstandard precedence for comparison operators
Previous Message Tom Lane 2007-12-27 20:42:26 Re: BUG #3841: core dump in uuid-ossp