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

Re: BUG #3822: Nonstandard precedence for comparisonoperators

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Pedro Gimeno" <pgsql-001(at)personal(dot)formauri(dot)es>,<pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #3822: Nonstandard precedence for comparisonoperators
Date: 2007-12-27 23:16:30
Message-ID: 4773DDED.EE98.0025.0@wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-bugs
>>> On Thu, Dec 27, 2007 at  4:22 PM, in message <21242(dot)1198794130(at)sss(dot)pgh(dot)pa(dot)us>,
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote: 
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:

> To the extent that you do believe the spec, there are more problems with
> our precedence rules than just where <= fits --- it looks to me like IS
> [NOT] NULL is at the wrong precedence, too.  And then there's the whole
> question of associativity.
 
Well, surely, the fact that there is more than one problem isn't,
by itself, an argument not to fix any of them.
 
>> 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.
> 
> Good luck implementing that --- the precedence is hard-wired into the
> bison grammar rules.  There are also extremely good reasons for not
> having GUC variables that affect parsing behavior.
 
But we have done so before, in the interests of converging on the
standard.
 
> Given that it's been this way for ten years and no one has complained
> before, I'm disinclined to change it, and even more disinclined to
> invest the effort that would be involved in letting the behavior vary
> at runtime.
 
That's a fair point.  It's very unlikely to bite an existing
PostgreSQL user very hard.  The pain could come in migrating a large
set of complex queries from another DBMS.  I don't recall seeing any
migration document to help people identify these issues up front,
but we should probably have one (if we don't) and this should
probably be mentioned.
 
Based on this discussion, I'll remind our staff to be generous in
the use of parentheses when doing ad hoc queries.
 
-Kevin
 


In response to

pgsql-bugs by date

Next:From: spol@mail.ruDate: 2007-12-28 14:01:47
Subject: help me please
Previous:From: Tom LaneDate: 2007-12-27 22:22:10
Subject: Re: BUG #3822: Nonstandard precedence for comparison operators

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group