locale changes

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: pgsql-patches <pgsql-patches(at)postgreSQL(dot)org>
Subject: locale changes
Date: 2000-07-20 12:18:59
Message-ID: Pine.LNX.3.96.1000720140305.11997L-101000@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


In the atache is patch with this:

SET LOCALE TO <value>
Set locale to <value>, the <value> must be correct for
current OS locale setting.

SHOW LOCALE
Show current locale setting for all categories.

RESET LOCALE
Set locale back to start-up setting.

Now, possible is change locale environment from client without backend
restart and under one postmaster can run more backends with different
locale setting.

All routines (formatting.c, cash.c, main.c) are correct for this change.

BTW. --- how plan is 'money' datetype in 7.1, remove?

Karel

An example:

test=# SHOW LOCALE;
NOTICE: Locale setting: LANG=C, CTYPE=C, NUMERIC=C, TIME=C, COLLATE=C,
MONETARY=C, MESSAGES=C
SHOW VARIABLE
test=# SELECT to_char(1023.5, 'L 9999D9');
to_char
-----------
1023.5
(1 row)

test=# SET LOCALE TO 'de_DE';
SET VARIABLE
test=# SELECT to_char(1023.5, 'L 9999D9');
to_char
------------
DM 1023,5
(1 row)

test=# SET LOCALE TO 'en_US';
SET VARIABLE
test=# SELECT to_char(1023.5, 'L 9999D9');
to_char
-----------
$ 1023.5
(1 row)

test=# RESET LOCALE;
RESET VARIABLE
test=# SELECT to_char(1023.5, 'L 9999D9');
to_char
-----------
1023.5
(1 row)

Attachment Content-Type Size
locale-07202000.patch.gz application/x-gzip 3.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2000-07-20 13:24:34 pg_dump with BLOBs UPDATED
Previous Message Adriaan Joubert 2000-07-20 11:36:34 Loading binary data into the database

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2000-07-20 15:16:23 Re: locale changes
Previous Message Larry Rosenman 2000-07-17 18:37:14 RE: Update: mac.c update, patch now on ftp