setting LC_NUMERIC

Started by fritz-bayer@web.deabout 20 years ago3 messagesgeneral
Jump to latest
#1fritz-bayer@web.de
fritz-bayer@web.de

Hi,

unfortunately I did not set the locales correct, when I created my
database. The result is, that the numeric type expects an american
format like "12.34".

Since I'm from europe, where this number will be represented as "12,34"
I would like to change it without having to recreate the database,
because it already contains data.

I set the lc_numeric in the postgres.conf but that did not help. I also
used:

=# SET LC_NUMERIC TO "de_DE@euro" ;
SET

In the psql client, but after that inserts with the european number
format also failed. I also changed the enviornment variables and
restarted the database server. No luck either.

How do I change the numeric format? I read the postgresql manual but
it's fishy about this and they ways they described I tried and failed.

Any advice is appreciated!

Fritz

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: fritz-bayer@web.de (#1)
Re: setting LC_NUMERIC

"fritz-bayer@web.de" <fritz-bayer@web.de> writes:

How do I change the numeric format?

You don't. You can use to_char and to_number to do locale-aware
transformations, but the base data types only handle the SQL-standard
representations of numbers.

regards, tom lane

#3Peter Eisentraut
peter_e@gmx.net
In reply to: fritz-bayer@web.de (#1)
Re: setting LC_NUMERIC

Am Mittwoch, 22. Februar 2006 14:26 schrieb fritz-bayer@web.de:

unfortunately I did not set the locales correct, when I created my
database. The result is, that the numeric type expects an american
format like "12.34".

You can't change that. The locale only affects the to_char function.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/