Re: json/jsonb/hstore operator precedence - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: json/jsonb/hstore operator precedence
Date
Msg-id 533B32BA.7060303@nasby.net
Whole thread Raw
In response to Re: json/jsonb/hstore operator precedence  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: json/jsonb/hstore operator precedence  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 4/1/14, 3:07 PM, Andrew Dunstan wrote:
>> What are cases where things would break if we changed the precedence of -> and ->>? ISTM that's what we really
shoulddo if there's some way to manage the backwards compatibility...
 
>
>
> There is no provision for setting the precedence of any operators. The precedence is set in the grammar, and these
allhave the same precedence. What you're suggesting would a cure far worse than the disease, I strongly suspect. You
justneed to learn to live with this.
 
>
> What really bugs me about the example is that <> has a different precedence from =, which seems more than odd. The
exampleworks just fine if you use = instead of <>. But I guess it's been that way for a very long time and there's not
muchto be done about it.
 

I'm confused... first you say there's no precedence and then you're saying that there is? Which is it?

ISTM that most languages set the priority of de-referencing operators to be quite high, so I don't see how that would
bea disaster?
 

Of course, changing the precedence of = and <> certainly would be a disaster; I'm not suggesting that.
-- 
Jim C. Nasby, Data Architect                       jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Next
From: Andrew Dunstan
Date:
Subject: Re: json/jsonb/hstore operator precedence