Re: The IYYY mess again - Mailing list pgsql-docs

From Tom Lane
Subject Re: The IYYY mess again
Date
Msg-id 17676.1419880351@sss.pgh.pa.us
Whole thread Raw
In response to Re: The IYYY mess again  (David G Johnston <david.g.johnston@gmail.com>)
Responses Re: The IYYY mess again
List pgsql-docs
David G Johnston <david.g.johnston@gmail.com> writes:
> Tom Lane-2 wrote
>> There is a warning against combining IYYY with MM/DD, but it's buried
>> in trivia far down the page.

> Can we move this warning/notice into code?  Basically warn/disallow
> IYYY-MM-DD (and similar) as a valid format?

> And why not make it an error.  If someone really needed to output mixed
> modes they would be able to concatenate the two halves together to get the
> desired result so it isn't like we are making it impossible to accomplish -
> but the typical mistake goes away.

I would say no, and no.  It's not at all unreasonable to want to print
"YYYY-MM-DD (IYYY-IDDD)" or something like that.  And even if we think
it's dumb, it's not to_char()'s place to tell people they can't print
silly combinations.  One could argue in fact that the only reason for
to_char() to live at all is to print "silly" combinations --- otherwise,
you might as well just cast your timestamp to text.

            regards, tom lane


pgsql-docs by date:

Previous
From: David G Johnston
Date:
Subject: Re: The IYYY mess again
Next
From: David Johnston
Date:
Subject: Re: The IYYY mess again