Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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: locale-07202000.patch.gz
Description: application/x-gzip (3.3 KB)

Responses

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group