Age function

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Age function
Дата
Msg-id 446B29DA.6010203@magproductions.nl
обсуждение исходный текст
Ответы Re: Age function  (Csaba Nagy <nagy@ecircle-ag.com>)
Re: Age function  (Berend Tober <btober@seaworthysys.com>)
Список pgsql-general
Hi,

I believe I already mentioned something along these lines as an aside,
but this time I need it to work...

Look here:

template1=> select age(now() + '01:30:00'::interval);
        age
------------------
  -17:02:41.247957
(1 row)

So, One and a half hour in the future is actually 17 days ago?
Interesting... Either I am doing something wrong, or postgres is, I have
my suspicions ;)

Now, what I tried to achieve was a numeric representation for the
interval. As an interval of (for example) a month is kind of hard to
translate into a number (28, 29, 30 or 31 days?), I figured adding the
interval to now() and calculating the age of the result. I figured that
would nicely give me what I want... For the types of intervals I use
(hours and minutes) this could have worked, but... well, see above.

For the record, I tried this first on 7.4.7 (debian packages... shrug)
and then on 8.1.3. Both show this behaviour.

Regards,
--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

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

Предыдущее
От: "Scott Venter"
Дата:
Сообщение: Re: [Linux] Suitable 64bit
Следующее
От: Tino Wildenhain
Дата:
Сообщение: Re: GUI Interface