Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ziv2a-0004lN-3r for pgsql-committers@arkaria.postgresql.org; Mon, 05 Oct 2015 01:58:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Ziv2Z-0005zP-3k for pgsql-committers@arkaria.postgresql.org; Mon, 05 Oct 2015 01:58:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Ziv2L-0005lp-I0 for pgsql-committers@postgresql.org; Mon, 05 Oct 2015 01:57:57 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Ziv2I-0002WZ-8I for pgsql-committers@postgresql.org; Mon, 05 Oct 2015 01:57:56 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1Ziv2G-0006m2-Tf; Sun, 04 Oct 2015 21:57:52 -0400 Date: Sun, 4 Oct 2015 21:57:52 -0400 From: Bruce Momjian To: Tom Lane Cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Further fix for psql's code for locale-aware formatting of numer Message-ID: <20151005015752.GA25308@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Offlist, I think it was this commit: commit 73a7c322c36bb96d4e2d053ff245b0f7b99f09e0 Author: Bruce Momjian Date: Sun Jul 10 03:46:13 2005 +0000 Add psql \pset numericsep to allow output numbers like 100,000.0 or 100.000,0. Eugen Nedelcu which I later wacked around too: commit 45a19efa9ec66fa35cc86671e2a1cebfe787fd9f Author: Bruce Momjian Date: Thu Jul 14 08:42:37 2005 +0000 Change numericsep to a boolean, and make it locale-aware. commit bd157821649ae203b9c8ce8daf4ec027a0003351 Author: Bruce Momjian Date: Thu Jul 14 21:12:41 2005 +0000 Enable multi-byte thousands_sep and decimal_point for numericsep. commit 507465525e8c3e4ebf0159ac07c915dd609cd6b3 Author: Bruce Momjian Date: Mon Jul 18 20:57:53 2005 +0000 \pset numericsep -> numericlocale. commit 8ddd22f2456af0155f9c183894f481203e86b76e Author: Bruce Momjian Date: Tue Sep 27 16:30:25 2005 +0000 Fix incorrect psql \x memory allocation for numericlocale. Redesign API to be less error-prone. Obviously this was all a very long time ago. --------------------------------------------------------------------------- On Fri, Sep 25, 2015 at 04:01:33AM +0000, Tom Lane wrote: > Further fix for psql's code for locale-aware formatting of numeric output. > > On closer inspection, those seemingly redundant atoi() calls were not so > much inefficient as just plain wrong: the author of this code either had > not read, or had not understood, the POSIX specification for localeconv(). > The grouping field is *not* a textual digit string but separate integers > encoded as chars. > > We'll follow the existing code as well as the backend's cash.c in only > honoring the first group width, but let's at least honor it correctly. > > This doesn't actually result in any behavioral change in any of the > locales I have installed on my Linux box, which may explain why nobody's > complained; grouping width 3 is close enough to universal that it's barely > worth considering other cases. Still, wrong is wrong, so back-patch. > > Branch > ------ > master > > Details > ------- > http://git.postgresql.org/pg/commitdiff/6325527d845b629243fb3f605af6747a7a4ac45f > > Modified Files > -------------- > src/bin/psql/print.c | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > > -- > Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-committers -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Roman grave inscription + -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers