setting LC_NUMERIC

Поиск
Список
Период
Сортировка
Искать

setting LC_NUMERIC

От:
"fritz-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

Re: setting LC_NUMERIC

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"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

Re: setting LC_NUMERIC

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
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/
FAQ