Re: wierd AND condition evaluation for plpgsql
От | Joel Burton |
---|---|
Тема | Re: wierd AND condition evaluation for plpgsql |
Дата | |
Msg-id | JGEPJNMCKODMDHGOBKDNCENICPAA.joel@joelburton.com обсуждение исходный текст |
Ответ на | Re: wierd AND condition evaluation for plpgsql (Alessio Bragadini <alessio@albourne.com>) |
Ответы |
Re: wierd AND condition evaluation for plpgsql
|
Список | pgsql-hackers |
> -----Original Message----- > From: pgsql-hackers-owner@postgresql.org > [mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Alessio > Bragadini > Sent: Thursday, May 30, 2002 9:04 AM > To: PostgreSQL Hackers > Subject: Re: [HACKERS] wierd AND condition evaluation for plpgsql > > > On Tue, 2002-05-28 at 16:09, Joel Burton wrote: > > > Actually, at least in some cases, PG does short-circuit logic: > > > joel@joel=# select false and seeme(); > > > joel@joel=# select true and seeme(); > > If seeme() returns NULL, shouldn't both SELECTs return NULL, and > therefore not be short-circuit-able? > > Sorry, I am a little confused. In my example, seeme() returns true, not NULL. However, the short-circuiting came from the other part (the simple true or false) being evaluated first. So, regardless of the returned value of seeme(), "SELECT FALSE AND seeme()" would short-circuit, since "FALSE AND ___" can never be true. Of course, if seemme() returns NULL, then the end result would be false. - J. Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Knowledge Management & Technology Consultant
В списке pgsql-hackers по дате отправления: