Re: Short circuit evaluation of expressions in query

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Jimmy Choi <JCHOI(at)altera(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Short circuit evaluation of expressions in query
Date: 2006-06-13 20:40:54
Message-ID: 20060613204054.GH19212@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 13, 2006 at 02:34:36PM -0400, Jimmy Choi wrote:
> Suppose that at runtime, $1 is supplied a value of -1, does the
> foo.status = $1 condition still have to be evaluated?

SQL doesn't offer any kind of guarentees about order of evaluations,
and neither does postgres. It may occasionally try in an effort to
reduce execution time, but there are no guarentees.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shane Ambler 2006-06-13 21:14:29 Re: State of Postgresql Replication?
Previous Message Ron Mayer 2006-06-13 20:28:27 Re: Fabian Pascal and RDBMS deficiencies in fully implementing