Re: wierd AND condition evaluation for plpgsql

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: wierd AND condition evaluation for plpgsql
Дата
Msg-id 1022613367.1902.9.camel@rh72.home.ee
обсуждение исходный текст
Ответ на Re: wierd AND condition evaluation for plpgsql  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: Null values in indexes
Следующее
От: "Joel Burton"
Дата:
Сообщение: Re: wierd AND condition evaluation for plpgsql