Re: 7.4 aggregate OR TRUE yields strange results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: SZŰCS Gábor <surrano(at)mailbox(dot)hu>
Cc: pgsql-bugs(at)postgresql(dot)org, TIR(at)yahoogroups(dot)com
Subject: Re: 7.4 aggregate OR TRUE yields strange results
Date: 2004-02-13 22:02:53
Message-ID: 4786.1076709773@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" <surrano(at)mailbox(dot)hu> writes:
> SELECT count(*)<0 OR TRUE FROM mytable WHERE condition
> dumps the whole tuples meeting the condition.

Wow, that's bizarre. The "x OR TRUE" expression will get simplified to
just TRUE, so that COUNT isn't really there at all, but that shouldn't
change the query semantics. And it seems to work correctly in 7.3.*
and before. Looking into it ...

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-02-13 22:28:43 Re: 7.4 aggregate OR TRUE yields strange results
Previous Message SZŰCS Gábor 2004-02-13 17:16:47 7.4 aggregate OR TRUE yields strange results