Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agdFz-0004Kd-M0 for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Mar 2016 19:06:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1agdFy-0004QU-9b for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Mar 2016 19:06:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agdFx-0004QG-SW for pgsql-bugs@postgresql.org; Thu, 17 Mar 2016 19:06:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agdFu-0007LH-8P for pgsql-bugs@postgresql.org; Thu, 17 Mar 2016 19:06:49 +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 u2HJ6f6g022321; Thu, 17 Mar 2016 15:06:41 -0400 From: Tom Lane To: Thomas Munro cc: David Fetter , PostgreSQL Bugs Subject: Re: to_char(OF) is broken In-reply-to: References: <20160316140238.GA9113@fetter.org> Comments: In-reply-to Thomas Munro message dated "Thu, 17 Mar 2016 16:14:22 +1300" Date: Thu, 17 Mar 2016 15:06:41 -0400 Message-ID: <22320.1458241601@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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Thomas Munro writes: > On Thu, Mar 17, 2016 at 3:23 PM, Thomas Munro > wrote: >> On Thu, Mar 17, 2016 at 3:02 AM, David Fetter wrote: >>> Fractional offset time zones should probably be in our regression test >>> suite for this feature. >> It looks like 2d87eedc made adjustments in accounting for padding >> negative numbers in several places, but the case of OF is different >> than the other places because it also has a sign for positive numbers, >> so no adjustment was necessary there. See attached. > ... and 9.4 has a different bug as you showed (missing abs). Here's a > patch for 9.4 that uses the same code as master for that switch case > (and adds the same regression test). > 9.5 doesn't have either of the bugs, but might as well have the same > regression test just to show that. This is still not quite right, as it would do the wrong thing for a zone '-00:30'. I'm not sure that such a zone exists in reality, but we might as well get it right. Will fix and commit. Thanks for looking at this! regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs