Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E495FB5DBDE for ; Wed, 18 May 2011 16:40:58 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 99614-01 for ; Wed, 18 May 2011 19:40:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id E2887B5DBF7 for ; Wed, 18 May 2011 16:40:50 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p4IJeiu23136; Wed, 18 May 2011 15:40:44 -0400 (EDT) From: Bruce Momjian Message-Id: <201105181940.p4IJeiu23136@momjian.us> Subject: Re: BUG #6028: age() function output contracts "months", but not any other units. In-Reply-To: <201105171435.p4HEZxNa071526@wwwmaster.postgresql.org> To: "Martin A. Brooks" Date: Wed, 18 May 2011 15:40:44 -0400 (EDT) CC: pgsql-bugs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/141 X-Sequence-Number: 30280 Martin A. Brooks wrote: > > The following bug has been logged online: > > Bug reference: 6028 > Logged by: Martin A. Brooks > Email address: martin@antibodyMX.net > PostgreSQL version: 9.0.4 > Operating system: Debian/GNU Linux 6 > Description: age() function output contracts "months", but not any > other units. > Details: > > Hi > > postgres=# select age(now(),'1973-12-20'::timestamp); > age > ----------------------------------------- > 37 years 4 mons 28 days 15:33:49.041831 > (1 row) > > > Note "mons" and not "months". And if "mons", why not "yrs" and "dys"? I was hoping someone else knew a good answer to this question, but now that no one replied --- I have no idea on it was done this way. I think this code came from Berkeley. My guess is that the spelling was based on the libc struct tm field names: int tm_mday; /* day of month (1 - 31) */ int tm_mon; /* month of year (0 - 11) */ int tm_year; /* year - 1900 */ The only clear answer I can think of is that "month" has five letters, and "year" and "day" have less then five letters. :-| Does anyone feel this is worth changing? I am concerned such a change would break many user applications. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +