Re: Short-circuit boolean evaluation

From: David Johnston <polobo(at)yahoo(dot)com>
To: pasman pasmański <pasman(dot)p(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Short-circuit boolean evaluation
Date: 2011-04-30 14:34:32
Message-ID: 171423D4-9229-4D56-B06B-58D29BB50A77@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

No. It will not be called
Or
No. Postgresql does not short-circuit boolean evaluations
?

On Apr 30, 2011, at 10:27, pasman pasmański <pasman(dot)p(at)gmail(dot)com> wrote:

> No.
>
> 2011/4/30, Jon Smark <jon(dot)smark(at)yahoo(dot)com>:
>> Hi,
>>
>> Does Postgresql perform short-circuit boolean evaluation both in SQL
>> and PL/pgSQL functions? As an example, suppose I have a function called
>> "do_stuff" which is computationally intensive. In the example below,
>> will it be called for rows for which the first predicate (foobar.id = $1)
>> is false?
>>
>> SELECT count(*) FROM foobar WHERE foobar.id = $1 AND do_stuff (foobar.name);
>>
>> Thanks!
>> Jon
>>
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>
>
> --
> ------------
> pasman
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2011-04-30 14:40:25 Re: Short-circuit boolean evaluation
Previous Message pasman pasmański 2011-04-30 14:27:10 Re: Short-circuit boolean evaluation