Re: wierd AND condition evaluation for plpgsql - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: wierd AND condition evaluation for plpgsql
Date
Msg-id 1022613367.1902.9.camel@rh72.home.ee
Whole thread Raw
In response to Re: wierd AND condition evaluation for plpgsql  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Tue, 2002-05-28 at 21:52, Peter Eisentraut wrote:
> Louis-David Mitterrand writes:
> 
> > Shouldn't plpgsql shortcut AND conditions when a previous one fails, as
> > perl does?
> 
> Shouldn't perl evaluate all operands unconditionally, like plpgsql does?
> 
> Seriously, if you want to change this you have to complain to the SQL
> standards committee.

Is plpgsl a SQL standards committee standard ?


and is the following non-standard ?

(itest is a 16k row test table with i in 1-16k)

hannu=# create sequence itest_seq;
CREATE
hannu=# select nextval('itest_seq');nextval 
---------      1
(1 row)

hannu=# select count(*) from itest where false and true;count 
-------    0
(1 row)

hannu=# select count(*) from itest where false and i =
nextval('itest_seq');count 
-------    0
(1 row)

hannu=# select nextval('itest_seq');nextval 
---------      2
(1 row)

hannu=# select count(*) from itest where i = nextval('itest_seq');count 
-------    0
(1 row)

hannu=# select nextval('itest_seq');nextval 
---------  16387
(1 row)

---------------------
Hannu




pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Null values in indexes
Next
From: "Joel Burton"
Date:
Subject: Re: wierd AND condition evaluation for plpgsql