dbTalk Databases Forums  

Re: [BUGS] BUG #2685: Wrong charset of server messages on client

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUG #2685: Wrong charset of server messages on client in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sergiy Vyshnevetskiy
 
Posts: n/a

Default Re: [BUGS] BUG #2685: Wrong charset of server messages on client - 10-10-2006 , 11:12 AM






On Tue, 10 Oct 2006, Sergiy Vyshnevetskiy wrote:

Quote:
On Tue, 10 Oct 2006, Tom Lane wrote:

"Sergiy Vyshnevetskiy" <serg (AT) vostok (DOT) net> writes:
Convert server messages to database charset.

This has been discussed before:
http://archives.postgresql.org/pgsql...8/msg00245.php

The magic pg_enc2iananame_tbl[] you reference in your patch does not
exist,
and if it did exist it wouldn't work on all platforms, since encoding
names aren't sufficiently well standardized :-(

It's not magic, it's from ICU patch. Want me to send you a copy?
Sorry. I thought it was more well-known. Just looked into gentoo portage -
they don't know about it eigther.

The patch is here:

http://people.freebsd.org/~girgen/po...-09-25.diff.gz

This is the current list of encodings, according to iana:

http://www.iana.org/assignments/character-sets

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #2  
Old   
Sergiy Vyshnevetskiy
 
Posts: n/a

Default Re: [BUGS] BUG #2685: Wrong charset of server messages on client - 10-10-2006 , 11:17 AM






On Tue, 10 Oct 2006, Sergiy Vyshnevetskiy wrote:

Quote:
On Tue, 10 Oct 2006, Sergiy Vyshnevetskiy wrote:

On Tue, 10 Oct 2006, Tom Lane wrote:

"Sergiy Vyshnevetskiy" <serg (AT) vostok (DOT) net> writes:
Convert server messages to database charset.

This has been discussed before:
http://archives.postgresql.org/pgsql...8/msg00245.php

The magic pg_enc2iananame_tbl[] you reference in your patch does not
exist,
and if it did exist it wouldn't work on all platforms, since encoding
names aren't sufficiently well standardized :-(

It's not magic, it's from ICU patch. Want me to send you a copy?

Sorry. I thought it was more well-known. Just looked into gentoo portage -
they don't know about it eigther.

The patch is here:

http://people.freebsd.org/~girgen/po...-09-25.diff.gz

This is the current list of encodings, according to iana:

http://www.iana.org/assignments/character-sets
ICU homepage is

http://icu.sourceforge.net/

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
  #3  
Old   
Sergiy Vyshnevetskiy
 
Posts: n/a

Default Re: [BUGS] BUG #2685: Wrong charset of server messages on client - 10-10-2006 , 11:25 AM



On Tue, 10 Oct 2006, Tom Lane wrote:

Quote:
"Sergiy Vyshnevetskiy" <serg (AT) vostok (DOT) net> writes:
Convert server messages to database charset.

This has been discussed before:
http://archives.postgresql.org/pgsql...8/msg00245.php

The magic pg_enc2iananame_tbl[] you reference in your patch does not exist,
and if it did exist it wouldn't work on all platforms, since encoding
names aren't sufficiently well standardized :-(
It's not magic, it's from ICU patch. Want me to send you a copy?

Quote:
This, however, uncovers another bug: PostgreSQL dumps the messages into
stderr/syslog as-is, without converting database data from database charset
to charset from LC_MESSAGES.

I'm quite unconvinced that that's a bug. If we tried to do a conversion
here, it would be trivial to set up denials of service for logging ---
just include a character in a comment in your SQL command that cannot be
converted to the LC_MESSAGES character set.
They have to be printed as escape sequences. I think that dumping raw
string data in log without converting them to printable form can be used
to mess up log viewer at least. (At most this can be a security breach.)

Having row multibyte characters mixed with characters in LC_CTYPE in the
log makes it less useful. Syslog would mangle them further to a complete
unrecognition.

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
  #4  
Old   
Sergiy Vyshnevetskiy
 
Posts: n/a

Default Re: [BUGS] BUG #2685: Wrong charset of server messages on client - 10-10-2006 , 12:02 PM



On Tue, 10 Oct 2006, Tom Lane wrote:

Quote:
Sergiy Vyshnevetskiy <serg (AT) vostok (DOT) net> writes:
It's not magic, it's from ICU patch. Want me to send you a copy?

You're missing my point, which is that non-ICU locale support doesn't
necessarily recognize the same encoding names. We would have done this
years ago if we had a solution to that problem.
We should use IANA-standard names. If it fails - it does nothing.
Anybody porting PostgreSQL to new platform can go over the list and make a
patch for their port.


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend


Reply With Quote
  #5  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2685: Wrong charset of server messages on client - 10-10-2006 , 03:36 PM



Sergiy Vyshnevetskiy <serg (AT) vostok (DOT) net> writes:
Quote:
Here is a new and improved patch, that closes security hole as well.
We really can't consider a patch like this, because not only does it
ignore the problem of multiple spellings of encoding names, but it
actually breaks existing functionality on platforms with a variant
spelling of the name. I think a minimum requirement ought to be that
it work with any of the spellings recognized by initdb.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.