interval output format available that removes ambiguity ? - Mailing list pgsql-general

From Karsten Hilbert
Subject interval output format available that removes ambiguity ?
Date
Msg-id 20040504122437.D650@hermes.hilbert.loc
Whole thread Raw
Responses Re: interval output format available that removes ambiguity ?  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
I have the need to output intervals (ages in this case).
PostgreSQL takes great care to handle months correctly (eg
take into account varying months lengths). This is only
possible if either end point or start point of an interval are
known. For post processing some of the ambiguity of what
"2 mons" means would be removed if "61 days" was returned.

Is there a way to tell PostgreSQL to return that type of
interval (eg use weeks, days, hours, minutes, seconds, ...
but not months and perhaps not even years [leap years, etc]) ?
to_char(interval, text) doesn't work as it is applied after
the fact.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

pgsql-general by date:

Previous
From: Manfred Koizar
Date:
Subject: Re: 7.4.2 Regression tests: test stats loops indefinately...
Next
From: Martin Marques
Date:
Subject: Re: Parenthesis in Queries