Re: short ciruit logic of plpgsql in 8.2

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Richard Broersma Jr" <rabroersma(at)yahoo(dot)com>
Cc: "General PostgreSQL List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: short ciruit logic of plpgsql in 8.2
Date: 2007-05-17 20:26:08
Message-ID: 162867790705171326u491283dl71c3e19be08adfb6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hello,

it depends on SQL. plpgsql hasn't own arithmetic unit. You can test it simply:

postgres=# create or replace function a() returns bool as $$ begin
raise notice 'a'; return true; end$$ language plpgsql;
CREATE FUNCTION
postgres=# create or replace function b() returns bool as $$ begin
raise notice 'a'; return true; end$$ language plpgsql;
CREATE FUNCTION
postgres=# select a() or b();
NOTICE: a
?column?
----------
t
(1 row)

result: statements are short circuited.

2007/5/17, Richard Broersma Jr <rabroersma(at)yahoo(dot)com>:
> Does anyone know if logic operations in plpgsql are short circuited in 8.2?
>
> Regards,
> Richard Broersma Jr.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert James 2007-05-17 20:41:04 Re: Postgres Printed Manuals
Previous Message Richard Broersma Jr 2007-05-17 20:01:59 short ciruit logic of plpgsql in 8.2