From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G Johnston <david.g.johnston@gmail.com>
Cc: pgsql-docs@postgresql.org
Subject: Re: The IYYY mess again
Date: Mon, 29 Dec 2014 14:12:31 -0500
Message-ID: <17676.1419880351@sss.pgh.pa.us> (raw)
In-Reply-To: <1419879652755-5832322.post@n5.nabble.com>
References: <5888.1419865569@sss.pgh.pa.us>
<1419879652755-5832322.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com
Subject: Re: The IYYY mess again
In-Reply-To: <17676.1419880351@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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