Re: [SQL] current_date vs 'now'

2009-02-05 Thread Jamie Tufnell
On 2/6/09, Tom Lane wrote: > As the view definition printout suggests, tomorrow this view will produce > > 2009-02-06 | 2009-02-05 > > because the constant isn't going to change. Thanks for that explanation Tom. Very clear and helpful. Jamie -- Sent via pgsql-sql mailing list (pgsql-sql@post

Re: [SQL] current_date vs 'now'

2009-02-05 Thread Tom Lane
Jamie Tufnell writes: > AFAIK current_date is standard and 'now' and 'today', etc are not... > so that's one reason to continuing using current_date. However, I > wonder why 'today' and current_date don't generate the same query > plan? 'today'::date is a special string that is recognized by the

[SQL] current_date vs 'now'

2009-02-04 Thread Jamie Tufnell
Hi, I was doing EXPLAIN ANALYZE on a query where I compare against current_date and noticed the following: Filter: (date <= ('now'::text)::date) I knew about now() but did not know about 'now' and have since learnt of 'today', 'tomorrow', etc. Great! So, I changed my condition to <= 'now' t