Re: converting from one locale to another - Mailing list pgsql-general

From Tom Lane
Subject Re: converting from one locale to another
Date
Msg-id 239.1055511617@sss.pgh.pa.us
Whole thread Raw
In response to converting from one locale to another  (Tony Grant <tony@tgds.net>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: query plan and parenthesis
Next
From: Tom Lane
Date:
Subject: Re: Insert NULL for ''