Re: AGE() function

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: AGE() function
Дата
Msg-id Pine.BSF.4.21.0103141147170.6508-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на AGE() function  (Michael Fork <mfork@toledolink.com>)
Список pgsql-general
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)


В списке pgsql-general по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Case Insensitive CHECK CONSTRAINTs
Следующее
От: Dan Lyke
Дата:
Сообщение: MetaData