On Wed, 14 Mar 2001, Michael Fork wrote:
> radius=# SELECT count(*) FROM radacct WHERE age(now(), tstamp) > '6
> months'::interval;
> count
> --------
> 128378
> (1 row)
>
> -- Up until this points everything makes sense, however what follows
> -- does not
>
> radius=# SELECT count(*) FROM radacct WHERE age(tstamp, now()) > '6 months
> ago'::interval;
> count
> ---------
> 1988641
> (1 row)
>
> -- Shouldn't this be equal to the previous query (flipped the arguments
> -- and added 'ago'
I'd guess that since 6 months ago is effectively a negative interval,
wouldn't you want to be comparing <'6 months ago'::interval for the
same effect?
(a-b>c -> b-a<-c or something)