pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #6028: age() function output contracts "months", but not any other units.
8+ messages / 6 participants
[nested] [flat]
* BUG #6028: age() function output contracts "months", but not any other units.
@ 2011-05-17 14:35 Martin A. Brooks <martin@antibodyMX.net>
2011-05-18 19:40 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 8+ messages in thread
From: Martin A. Brooks @ 2011-05-17 14:35 UTC (permalink / raw)
To: pgsql-bugs
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"?
Regards
Martin A. Brooks
http://antibodyMX.net/
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #6028: age() function output contracts "months", but not any other units.
2011-05-17 14:35 BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodyMX.net>
@ 2011-05-18 19:40 ` Bruce Momjian <bruce@momjian.us>
2011-05-23 17:15 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Robert Haas <robertmhaas@gmail.com>
0 siblings, 1 reply; 8+ messages in thread
From: Bruce Momjian @ 2011-05-18 19:40 UTC (permalink / raw)
To: Martin A. Brooks <martin@antibodyMX.net>; +Cc: pgsql-bugs
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 <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #6028: age() function output contracts "months", but not any other units.
2011-05-17 14:35 BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodyMX.net>
2011-05-18 19:40 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Bruce Momjian <bruce@momjian.us>
@ 2011-05-23 17:15 ` Robert Haas <robertmhaas@gmail.com>
2011-05-23 18:02 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: Robert Haas @ 2011-05-23 17:15 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Martin A. Brooks <martin@antibodymx.net>; pgsql-bugs
On Wed, May 18, 2011 at 3:40 PM, Bruce Momjian <bruce@momjian.us> wrote:
> 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.
The backward compatibility problem is pretty icky, but I don't much
like the idea of leaving it as-is, either.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #6028: age() function output contracts "months", but not any other units.
2011-05-17 14:35 BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodyMX.net>
2011-05-18 19:40 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Bruce Momjian <bruce@momjian.us>
2011-05-23 17:15 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Robert Haas <robertmhaas@gmail.com>
@ 2011-05-23 18:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-05-23 18:44 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodymx.net>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2011-05-23 18:02 UTC (permalink / raw)
To: Robert Haas <robertmhaas@gmail.com>; +Cc: Bruce Momjian <bruce@momjian.us>; Martin A. Brooks <martin@antibodymx.net>; pgsql-bugs
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, May 18, 2011 at 3:40 PM, Bruce Momjian <bruce@momjian.us> wrote:
>> Does anyone feel this is worth changing? I am concerned such a change
>> would break many user applications.
> The backward compatibility problem is pretty icky, but I don't much
> like the idea of leaving it as-is, either.
ISTM that changing interval's output formatting would create far too
many problems to be justifiable for such a purely cosmetic issue.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #6028: age() function output contracts "months", but not any other units.
2011-05-17 14:35 BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodyMX.net>
2011-05-18 19:40 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Bruce Momjian <bruce@momjian.us>
2011-05-23 17:15 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Robert Haas <robertmhaas@gmail.com>
2011-05-23 18:02 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Tom Lane <tgl@sss.pgh.pa.us>
@ 2011-05-23 18:44 ` Martin A. Brooks <martin@antibodymx.net>
2011-05-23 18:50 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Tom Lane <tgl@sss.pgh.pa.us>
2011-05-23 19:17 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Kevin Grittner <Kevin.Grittner@wicourts.gov>
0 siblings, 2 replies; 8+ messages in thread
From: Martin A. Brooks @ 2011-05-23 18:44 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Robert Haas <robertmhaas@gmail.com>; Bruce Momjian <bruce@momjian.us>; Martin A. Brooks <martin@antibodymx.net>; pgsql-bugs
On Mon, May 23, 2011 19:02, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Wed, May 18, 2011 at 3:40 PM, Bruce Momjian <bruce@momjian.us> wrote:
>>> Does anyone feel this is worth changing? I am concerned such a change
>>> would break many user applications.
>
>> The backward compatibility problem is pretty icky, but I don't much
>> like the idea of leaving it as-is, either.
>
> ISTM that changing interval's output formatting would create far too
> many problems to be justifiable for such a purely cosmetic issue.
I almost entirely agree with you except....
My current $dayjob is working in an industry where details and aesthetics
are everything. We will spend thousands of hours of processor time just
to make sure than the sheen on an animal's fur will suggest "healthy and
luxuriant" rather than "warm and moist". It's about artistic polish.
If people are agreeing that this is not the intended, desrired or
specified output for this function, then make with the polish. It isn't
the first, and won't be the last, time that something has potentially
broken compatibility in postgres.
EUR0.02
Regards
Martin.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #6028: age() function output contracts "months", but not any other units.
2011-05-17 14:35 BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodyMX.net>
2011-05-18 19:40 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Bruce Momjian <bruce@momjian.us>
2011-05-23 17:15 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Robert Haas <robertmhaas@gmail.com>
2011-05-23 18:02 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Tom Lane <tgl@sss.pgh.pa.us>
2011-05-23 18:44 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodymx.net>
@ 2011-05-23 18:50 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-05-23 18:58 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodymx.net>
1 sibling, 1 reply; 8+ messages in thread
From: Tom Lane @ 2011-05-23 18:50 UTC (permalink / raw)
To: Martin A. Brooks <martin@antibodymx.net>; +Cc: Robert Haas <robertmhaas@gmail.com>; Bruce Momjian <bruce@momjian.us>; pgsql-bugs
"Martin A. Brooks" <martin@antibodymx.net> writes:
> On Mon, May 23, 2011 19:02, Tom Lane wrote:
>> ISTM that changing interval's output formatting would create far too
>> many problems to be justifiable for such a purely cosmetic issue.
> I almost entirely agree with you except....
> My current $dayjob is working in an industry where details and aesthetics
> are everything. We will spend thousands of hours of processor time just
> to make sure than the sheen on an animal's fur will suggest "healthy and
> luxuriant" rather than "warm and moist". It's about artistic polish.
> If people are agreeing that this is not the intended, desrired or
> specified output for this function, then make with the polish. It isn't
> the first, and won't be the last, time that something has potentially
> broken compatibility in postgres.
I think possibly you misunderstand the scope of the breakage you're
proposing. This is not about the age() function. It's interval_out()
that's at stake, and so changing this would change the output formatting
for *every* operation that yields intervals. That makes it pretty
high-risk.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #6028: age() function output contracts "months", but not any other units.
2011-05-17 14:35 BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodyMX.net>
2011-05-18 19:40 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Bruce Momjian <bruce@momjian.us>
2011-05-23 17:15 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Robert Haas <robertmhaas@gmail.com>
2011-05-23 18:02 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Tom Lane <tgl@sss.pgh.pa.us>
2011-05-23 18:44 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodymx.net>
2011-05-23 18:50 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Tom Lane <tgl@sss.pgh.pa.us>
@ 2011-05-23 18:58 ` Martin A. Brooks <martin@antibodymx.net>
0 siblings, 0 replies; 8+ messages in thread
From: Martin A. Brooks @ 2011-05-23 18:58 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Martin A. Brooks <martin@antibodymx.net>; Robert Haas <robertmhaas@gmail.com>; Bruce Momjian <bruce@momjian.us>; pgsql-bugs
On Mon, May 23, 2011 19:50, Tom Lane wrote:
> I think possibly you misunderstand the scope of the breakage you're
> proposing. This is not about the age() function. It's interval_out()
> that's at stake, and so changing this would change the output formatting
> for *every* operation that yields intervals. That makes it pretty
> high-risk.
I didn't, but now do, and can appreciate your caution.
Regards
Martin.
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: BUG #6028: age() function output contracts "months", but not any other units.
2011-05-17 14:35 BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodyMX.net>
2011-05-18 19:40 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Bruce Momjian <bruce@momjian.us>
2011-05-23 17:15 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Robert Haas <robertmhaas@gmail.com>
2011-05-23 18:02 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Tom Lane <tgl@sss.pgh.pa.us>
2011-05-23 18:44 ` Re: BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodymx.net>
@ 2011-05-23 19:17 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
1 sibling, 0 replies; 8+ messages in thread
From: Kevin Grittner @ 2011-05-23 19:17 UTC (permalink / raw)
To: Martin A. Brooks <martin@antibodymx.net>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Robert Haas <robertmhaas@gmail.com>; Bruce Momjian <bruce@momjian.us>; pgsql-bugs
"Martin A. Brooks" <martin@antibodymx.net> wrote:
> My current $dayjob is working in an industry where details and
> aesthetics are everything. We will spend thousands of hours of
> processor time just to make sure than the sheen on an animal's fur
> will suggest "healthy and luxuriant" rather than "warm and moist".
> It's about artistic polish.
>
> If people are agreeing that this is not the intended, desrired or
> specified output for this function, then make with the polish.
Of course, you can always write your own function to output in as
polished a format as you would prefer, without breaking anything for
anyone else.
-Kevin
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2011-05-23 19:17 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-05-17 14:35 BUG #6028: age() function output contracts "months", but not any other units. Martin A. Brooks <martin@antibodyMX.net>
2011-05-18 19:40 ` Bruce Momjian <bruce@momjian.us>
2011-05-23 17:15 ` Robert Haas <robertmhaas@gmail.com>
2011-05-23 18:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-05-23 18:44 ` Martin A. Brooks <martin@antibodymx.net>
2011-05-23 18:50 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-05-23 18:58 ` Martin A. Brooks <martin@antibodymx.net>
2011-05-23 19:17 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox