pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Pradier <david.pradier@clarisys.fr>
Cc: pgsql-sql@postgresql.org
Subject: Re: Order of precedence between AND and OR.
Date: Fri, 25 Nov 2005 14:59:03 -0500
Message-ID: <26190.1132948743@sss.pgh.pa.us> (raw)
In-Reply-To: <20051125165259.GE4482@clarisys.fr>
References: <20051125165259.GE4482@clarisys.fr>

David Pradier <david.pradier@clarisys.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



view thread (2+ messages)

Message-ID: <26190.1132948743@sss.pgh.pa.us>
Permalink:  ../26190.1132948743@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26190.1132948743@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.pradier@clarisys.fr
  Subject: Re: Order of precedence between AND and OR.
  In-Reply-To: <26190.1132948743@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox