Search Postgresql Archives

Re: question about age()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Kretschmer <akretschmer@xxxxxxxxxxxxx> writes:
> '3 years' != '2 years 11 mons 30 days', but i got 0 rows, why?

Well, actually:

regression=# select '3 years'::interval = '2 years 11 mons 30 days'::interval;
 ?column? 
----------
 t
(1 row)

IIRC, interval comparison operators normalize the two values assuming that
1 month = 30 days.  Which is kind of arbitrary, but without some such
assumption there's no way to have a scalar ordering of intervals at all.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux