Skip site navigation (1) Skip section navigation (2)

Re: thousands comma numeric formatting in psql

From: Eugen Nedelcu <eugen(at)sifolt(dot)ro>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: thousands comma numeric formatting in psql
Date: 2005-06-22 08:54:40
Message-ID: 20050622085440.GA371@sifolt.ro (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Hello,

I have included my patch attached to this mail.

I have made the changes to deal with locale settings from client
environment. So now you can start psql like this:

(export LC_ALL=ro_RO; psql -U user db)

and have numeric formatting with '.' as thousands separator and
',' as decimal point, or

(export LC_ALL=en_US; psql -U user db)

and have numeric formatting with ',' as thousands separator and
'.' as decimal point. This formatting is default when locale is 'C'

You can set any locale and numeric formatting code will take it in
consideration.

This patch is for version 7.3.2. The steps for install is:

1) cp thousands_comma.diff $POSTGRES_DIR/src/bin/psql
2) cd $POSTGRES_DIR/src/bin/psql
3) patch -p0 < thousands_comma.diff
4) ../../../configure && make


Best Regards,
Eugen

In response to

Responses

pgsql-hackers by date

Next:From: Dave CramerDate: 2005-06-22 11:20:47
Subject: Re: PROPOSAL FE/BE extension to handle IN/OUT parameters
Previous:From: Dave PageDate: 2005-06-22 08:20:38
Subject: Re: Server instrumentation patch

pgsql-patches by date

Next:From: Andrew DunstanDate: 2005-06-22 11:25:57
Subject: Re: pl/pgsql: END verbosity
Previous:From: Neil ConwayDate: 2005-06-22 05:29:44
Subject: Re: pl/pgsql: END verbosity

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group