473,326 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Locale bug?


Here is a simplificated example:

CREATE OR REPLACE FUNCTION ttt () RETURNS text AS '
return "";
' LANGUAGE 'plperlu';

CREATE OR REPLACE FUNCTION qqq () RETURNS text as '
DECLARE
v_text text;
v_text2 text;
BEGIN
v_text := upper(''ÄÏ''); -- cyrillic chars
v_text2 := ttt();
RETURN v_text || upper(''ÐÏÓÌÅ''); -- cyrillic chars
END;
' LANGUAGE 'plpgsql';

and qqq() returns "äïÐÏÓÌÅ". That is upper() doesn't work correctly
after plperlu function call.

--
Sergey Suleymanov
Nov 12 '05 #1
5 1244
Sergey Suleymanov <so**@eatpbank.ru> writes:
... That is upper() doesn't work correctly
after plperlu function call.


It sounds like Perl is taking it on itself to change the process'
LC_CTYPE settings. That's very nasty of it :-(. Can anyone confirm
that libperl does such things, or find a workaround to prevent it?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #2
>>>>> Tom Lane writes:
... That is upper() doesn't work correctly after plperlu function
call.


Tom> It sounds like Perl is taking it on itself to change the
Tom> process' LC_CTYPE settings. That's very nasty of it :-(. Can
Tom> anyone confirm that libperl does such things, or find a
Tom> workaround to prevent it?

It seems a startup script issue. When I restarting postmaster
manualy (within root session with LC_CTYPE = ru_RU.KOI8-R)
everything works fine.

Do we need "export LANG=..." before starting postmaster?

--
Sergey Suleymanov
Nov 12 '05 #3
Sergey Suleymanov <so**@eatpbank.ru> writes:
Tom Lane writes:
... That is upper() doesn't work correctly after plperlu function
call.
Tom> It sounds like Perl is taking it on itself to change the
Tom> process' LC_CTYPE settings. That's very nasty of it :-(. Can
Tom> anyone confirm that libperl does such things, or find a
Tom> workaround to prevent it? It seems a startup script issue. When I restarting postmaster
manualy (within root session with LC_CTYPE = ru_RU.KOI8-R)
everything works fine. Do we need "export LANG=..." before starting postmaster?


Hm. The postmaster extracts the correct setlocale() values from the
pg_control file, but IIRC it doesn't bother to set the environment
variables LC_CTYPE etc. Maybe it should. Peter, I think this is your
turf --- what do you think?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #4
>>>>> Tom Lane writes:
... That is upper() doesn't work correctly after plperlu function
call.


Tom> It sounds like Perl is taking it on itself to change the
Tom> process' LC_CTYPE settings. That's very nasty of it :-(. Can
Tom> anyone confirm that libperl does such things, or find a
Tom> workaround to prevent it?

It seems a startup script issue. When I restarting postmaster
manualy (within root session with LC_CTYPE = ru_RU.KOI8-R)
everything works fine.

Do we need "export LANG=..." before starting postmaster?

--
Sergey Suleymanov
Nov 12 '05 #5
Sergey Suleymanov <so**@eatpbank.ru> writes:
Tom Lane writes:
... That is upper() doesn't work correctly after plperlu function
call.
Tom> It sounds like Perl is taking it on itself to change the
Tom> process' LC_CTYPE settings. That's very nasty of it :-(. Can
Tom> anyone confirm that libperl does such things, or find a
Tom> workaround to prevent it? It seems a startup script issue. When I restarting postmaster
manualy (within root session with LC_CTYPE = ru_RU.KOI8-R)
everything works fine. Do we need "export LANG=..." before starting postmaster?


Hm. The postmaster extracts the correct setlocale() values from the
pg_control file, but IIRC it doesn't bother to set the environment
variables LC_CTYPE etc. Maybe it should. Peter, I think this is your
turf --- what do you think?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ksenia Marasanova | last post by:
Hi, I have some problems with locale module. On my workstation, changing locale doesn't have effect: Python 2.3 (#1, Sep 13 2003, 00:49:11) on darwin Type "help", "copyright", "credits" or...
2
by: Jorgen Grahn | last post by:
I'm sitting here with a Debian Linux 'Woody' system with the default Python 2.2 installation, and I want the re module to understand that re.compile(r'\W+'. re.LOCALE) doesn't match my national,...
1
by: Cagdas Ozgenc | last post by:
Greetings. I am confused about C++ standard library locale stuff. It seems as if the implementations of locales are not part of the library, but only some guideline classes are there. What is...
0
by: | last post by:
Hi all, running the following code as an console application: #include <locale> #include <iostream> #include <sstream> #include <tchar.h> using namespace std;
3
by: robert | last post by:
Why can the default locale not be set by its true name? but only by '' ? : PythonWin 2.5 (r25:51908, Sep 19 2006, 09:52:17) on win32. (None, None) Traceback (most recent call last): File...
2
by: cris | last post by:
Hi, I got trouble when I try to change the locale used in a program foo.cc // ----------------- begin #include <iostream> #include <locale> #include <exception> using namespace std; int...
2
by: Daniele C. | last post by:
I will report a snippet from http://php.net/setlocale I spent about 2 seconds before thinking: can it really be? I mean, is there no way to set locale info per thread? And after a brief web...
24
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything...
0
by: Roman Bertle | last post by:
Hello, I try to format monetary values using the locale module, python2.5: Python 2.5.2a0 (r251:54863, Jan 3 2008, 17:59:56) on linux2 Type "help", "copyright", "credits" or "license" for...
3
by: Mario Ruggier | last post by:
Hi, i had the following problem when installing py3.0rc1 on a Mac OS X 10.5.5. On this system, the default locale values are: $ locale LANG= LC_COLLATE="C" LC_CTYPE="UTF-8" LC_MESSAGES="C"
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.