Re: Order of precedence between AND and OR.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Pradier <david(dot)pradier(at)clarisys(dot)fr>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Order of precedence between AND and OR.
Date: 2005-11-25 19:59:03
Message-ID: 26190.1132948743@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

David Pradier <david(dot)pradier(at)clarisys(dot)fr> writes:
> 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.

AND first; see
http://www.postgresql.org/docs/8.1/static/sql-syntax.html#SQL-PRECEDENCE
This is required by the SQL spec.

But you probably also want to read
http://www.postgresql.org/docs/8.1/static/sql-expressions.html#SYNTAX-EXPRESS-EVAL

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Vivek Khera 2005-11-26 03:22:38 Re: sysid
Previous Message Tom Lane 2005-11-25 19:22:08 Re: Variable column names in PL/pgSQL RECORD referencces