Order of precedence between AND and OR.

From: David Pradier <david(dot)pradier(at)clarisys(dot)fr>
To: pgsql-sql(at)postgresql(dot)org
Subject: Order of precedence between AND and OR.
Date: 2005-11-25 16:52:59
Message-ID: 20051125165259.GE4482@clarisys.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi everybody,

during the code inspection due to our migration to 8.1,
I found a piece of SQL code written like this :

WHERE a AND b OR c AND d

Now, I know that AND and OR are commutative because it's written in the
docs.
But what I couldn't find is if there is an order of precedence between
AND and OR, that is if the AND expression is calculated before the OR
one, or anyelse way.

Could somebody tell me or point me to the right doc ?

Thanks in advance,
David

--
David Pradier -- Directeur Technique de Clarisys Informatique -- Chef de projet logiciels libres / open-source

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ken Winter 2005-11-25 18:01:40 Variable column names in PL/pgSQL RECORD referencces
Previous Message Stéphane RIFF 2005-11-25 16:24:27 Re: LISTEN/NOTIFY