Hi
I had a view :
CREATE VIEWtrafic_day
ASSELECT stats.ip, date(stats."time") AS date, count(*) AS nb, sum(stats.packet) AS packet, sum(stats.traffic) AS
trafficFROMstatsGROUP BY stats.ip, date(stats."time")ORDER BY sum(stats.traffic) DESC;
I wanted to add some test on time, so I did a
CREATE VIEWtrafic_day
ASSELECT stats.ip, date(stats."time") AS date, count(*) AS nb, sum(stats.packet) AS packet, sum(stats.traffic) AS
trafficFROMstatsWHERE time::date < 'now'::dateGROUP BY stats.ip, date(stats."time")ORDER BY sum(stats.traffic) DESC;
which
show up as :
=> select definition from pg_views where viewname = 'trafic_day';
SELECT stats.ip, date(stats."time") AS date, count(*) AS nb,
sum(stats.packet) AS packet, sum(stats.traffic) AS traffic FROM stats WHERE
(date(stats."time") < '2002-03-28'::date) GROUP BY stats.ip,
date(stats."time") ORDER BY sum(stats.traffic) DESC;
the 'now' is gone and I have the value of it instead of what I wanted...
--
Mathieu Arnold