Обсуждение: converting from one locale to another

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

converting from one locale to another

От
Tony Grant
Дата:
Hello,

I need to convert an existing database from the default locale to locale
fr_FR because the client is fed up of using "." as a decimal
separator...

Can I just import my dump file and all the decimal points will be
converted auto-magically?

Cheers

Tony Grant
--
www.tgds.net Library management software toolkit,
redhat linux on Sony Vaio C1XD,
Dreamweaver MX with Tomcat and PostgreSQL


Re: converting from one locale to another

От
Tom Lane
Дата:
Tony Grant <tony@tgds.net> writes:
> I need to convert an existing database from the default locale to locale
> fr_FR because the client is fed up of using "." as a decimal
> separator...

> Can I just import my dump file and all the decimal points will be
> converted auto-magically?

You do not need to dump/reload to change LC_MONETARY; a quick SET will
do, or change the default in postgresql.conf.

That's the good news.  The bad news is that ordinary I/O of numbers does
not pay attention to LC_MONETARY (by design, and per SQL spec, so don't
bother complaining).  The only formatting that does pay attention is
to_char() and to_number() conversion.  So, while you don't need to do
anything much to your data, you do have a bit of SQL coding in front
of you to use those functions where appropriate.

            regards, tom lane