Re: [BUGS] Should the optimizer optimize "current_date - interval '1 days'" (fwd)

2002-06-03 Thread Tom Lane
Ron Mayer <[EMAIL PROTECTED]> writes: > where dat > (current_date - interval '1 days'); > never uses the index I have on "fact". I suppose dat is of type date? > Should it treat my current_dat... expression as a constant and use > the index? Or is there a good reason it doesn't? You will n

[BUGS] Should the optimizer optimize "current_date - interval '1 days'"(fwd)

2002-06-03 Thread Ron Mayer
On a very big table (a data warehouse with >10 million rows), I frequently run queries looking at the past few days. However queries like this: select count(*) from fact where dat > (current_date - interval '1 days'); never uses the index I have on "fact". (Thanks to previous querie

Re: [BUGS] BUG: mismatched parentheses

2002-06-03 Thread Stephan Szabo
On Tue, 28 May 2002, Brendon Matthews wrote: > Hi, > > I have found a bug in PostgreSQL 7.2.1. > > I am trying to use plpgsql to run a simple INSERT on a table, and it always > comes up with an error saying "mismatched parentheses" > > I firstly store the SQL in a TEXT variable: > a_sql := ''INS