Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5fk5-0002j0-Ky for pgsql-docs@arkaria.postgresql.org; Mon, 29 Dec 2014 19:12:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y5fk5-0002DY-5x for pgsql-docs@arkaria.postgresql.org; Mon, 29 Dec 2014 19:12:37 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y5fk4-0002DS-It for pgsql-docs@postgresql.org; Mon, 29 Dec 2014 19:12:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y5fk1-0004c6-OO for pgsql-docs@postgresql.org; Mon, 29 Dec 2014 19:12:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sBTJCVhG017677; Mon, 29 Dec 2014 14:12:31 -0500 From: Tom Lane To: David G Johnston cc: pgsql-docs@postgresql.org Subject: Re: The IYYY mess again In-reply-to: <1419879652755-5832322.post@n5.nabble.com> References: <5888.1419865569@sss.pgh.pa.us> <1419879652755-5832322.post@n5.nabble.com> Comments: In-reply-to David G Johnston message dated "Mon, 29 Dec 2014 12:00:52 -0700" Date: Mon, 29 Dec 2014 14:12:31 -0500 Message-ID: <17676.1419880351@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org David G Johnston 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