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

BUG #4186: set lc_messages does not work

From: "Thomas H" <me(at)alternize(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4186: set lc_messages does not work
Date: 2008-05-22 03:08:45
Message-ID: 200805220308.m4M38jVL055561@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
The following bug has been logged online:

Bug reference:      4186
Logged by:          Thomas H
Email address:      me(at)alternize(dot)com
PostgreSQL version: 8.3.1
Operating system:   Windows 2003
Description:        set lc_messages does not work
Details: 

the patch discussed here [1] that supposedly made the win32 msvc builds use
lc_locale properly has flaws.

while indeed it does force pgsql to use the native win32 locale for error
messages (before 8.3.1, system messages were always english), it broke the
functionality to actually have the lc_messages locale set manually through
conf or in a user session.

the following output is from a win2003 system with German_Switzerland.1252
locale. the queries are identically to the one used as examples by the patch
author. 
i have added a "select x;" to trigger a system error message to show that
its actually misbehaving - all output is always in (swiss) german despite
the set locale.

- thomas

[1]
http://archives.postgresql.org/pgsql-patches/2008-02/msg00038.php 

--------------------------------

Dies ist psql 8.3.1, das interaktive PostgreSQL-Terminal.

Geben Sie ein:  \copyright fr Urheberrechtsinformationen
                \h fr Hilfe ber SQL-Anweisungen
                \? fr Hilfe ber interne Anweisungen
                \g oder Semikolon, um eine Anfrage auszufhren
                \q um zu beenden

Warnung: Konsolencodeseite (850) unterscheidet sich von der Windows-
         Codeseite (1252). 8-Bit-Zeichen funktionieren mglicherweise
nicht
         richtig. Einzelheiten finden Sie auf der psql-Handbuchseite unter
         Notes for Windows users.

endor=# set lc_messages to 'sv_SE';
SET
endor=# select to_char((current_date + s.a),'TMDay TMMonth YYYY') as dates
from
 generate_series(0,6) as s(a);
        dates
---------------------
 Donnerstag Mai 2008
 Freitag Mai 2008
 Samstag Mai 2008
 Sonntag Mai 2008
 Montag Mai 2008
 Dienstag Mai 2008
 Mittwoch Mai 2008
(7 Zeilen)

endor=# select x;
FEHLER:  Spalte x existiert nicht
ZEILE 1: select x;
                ^
endor=#
endor=# set lc_messages to 'de_DE';
SET
endor=# select to_char((current_date + s.a),'TMDay TMMonth YYYY') as dates
from
 generate_series(0,6) as s(a);
        dates
---------------------
 Donnerstag Mai 2008
 Freitag Mai 2008
 Samstag Mai 2008
 Sonntag Mai 2008
 Montag Mai 2008
 Dienstag Mai 2008
 Mittwoch Mai 2008
(7 Zeilen)

endor=# select x;
FEHLER:  Spalte x existiert nicht
ZEILE 1: select x;
                ^
endor=#
endor=# set lc_messages to 'English_United_States';
SET
endor=# select to_char((current_date + s.a),'TMDay TMMonth YYYY') as dates
from
 generate_series(0,6) as s(a);
        dates
---------------------
 Donnerstag Mai 2008
 Freitag Mai 2008
 Samstag Mai 2008
 Sonntag Mai 2008
 Montag Mai 2008
 Dienstag Mai 2008
 Mittwoch Mai 2008
(7 Zeilen)

endor=# select x;
FEHLER:  Spalte x existiert nicht
ZEILE 1: select x;
                ^
endor=#
endor=# set lc_messages to 'fr';
SET
endor=# select to_char((current_date + s.a),'TMDay TMMonth YYYY') as dates
from
 generate_series(0,6) as s(a);
        dates
---------------------
 Donnerstag Mai 2008
 Freitag Mai 2008
 Samstag Mai 2008
 Sonntag Mai 2008
 Montag Mai 2008
 Dienstag Mai 2008
 Mittwoch Mai 2008
(7 Zeilen)

endor=# select x;
FEHLER:  Spalte x existiert nicht
ZEILE 1: select x;

Responses

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2008-05-22 06:42:11
Subject: why SPI_execute_with_args don't use known values for optimalisation
Previous:From: Robert HaasDate: 2008-05-22 02:33:12
Subject: Re: idea: storing view source in system catalogs

pgsql-bugs by date

Next:From: Richard EvansDate: 2008-05-22 06:34:34
Subject: Re: Deadlock condition in driver
Previous:From: TIAN JustinDate: 2008-05-22 02:15:19
Subject: Re: error message "psql: expected authentication request from server, but received " when using psql to connect remote database

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