pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Law <exclusion@gmail.com>
To: Tatsuo Ishii <ishii@postgresql.org>
Cc: pgsql-general@postgresql.org
Cc: ringerc@ringerc.id.au
Cc: yi.codeplayer@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: main log encoding problem
Date: Thu, 19 Jul 2012 10:37:49 +0400
Message-ID: <5007AB3D.3010501@gmail.com> (raw)
In-Reply-To: <20120719.081626.240539691760651172.t-ishii@sraoss.co.jp>
References: <1332187409-sup-4631@alvh.no-ip.org>
	<50067916.8010508@gmail.com>
	<5006D340.4000808@gmail.com>
	<20120719.081626.240539691760651172.t-ishii@sraoss.co.jp>

Hello,

>> C. We have one logfile with UTF-8.
>> Pros: Log messages of all our clients can fit in it. We can use any
>> generic editor/viewer to open it.
>> Nothing changes for Linux (and other OSes with UTF-8 encoding).
>> Cons: All the strings written to log file should go through some
>> conversation function.
>>
>> I think that the last solution is the solution. What is your opinion?
> I am thinking about variant of C.
>
> Problem with C is, converting from other encoding to UTF-8 is not
> cheap because it requires huge conversion tables. This may be a
> serious problem with busy server. Also it is possible some information
> is lossed while in this conversion. This is because there's no
> gualntee that there is one-to-one-mapping between UTF-8 and other
> encodings. Other problem with UTF-8 is, you have to choose *one*
> locale when using your editor. This may or may not affect handling of
> string in your editor.
>
> My idea is using mule-internal encoding for the log file instead of
> UTF-8. There are several advantages:
>
> 1) Converion to mule-internal encoding is cheap because no conversion
>     table is required. Also no information loss happens in this
>     conversion.
>
> 2) Mule-internal encoding can be handled by emacs, one of the most
>     popular editors in the world.
>
> 3) No need to worry about locale. Mule-internal encoding has enough
>     information about language.
> --
>
I believe that postgres has such conversion functions anyway. And they 
used for data conversion when we have clients (and databases) with 
different encodings. So if they can be used for data, why not to use 
them for relatively little amount of log messages?
And regarding mule internal encoding - reading about Mule 
http://www.emacswiki.org/emacs/UnicodeEncoding I found:
/In future (probably Emacs 22), Mule will use an internal encoding which 
is a UTF-8 encoding of a superset of Unicode. /
So I still see UTF-8 as a common denominator for all the encodings.
I am not aware of any characters absent in Unicode. Can you please 
provide some examples of these that can results in lossy conversion?
?hoosing UTF-8 in a viewer/editor is no big deal too. Most of them 
detect UTF-8 automagically, and for the others BOM can be added.

Best regards,
Aexander

view thread (21+ messages)  latest in thread

Message-ID: <5007AB3D.3010501@gmail.com>
Permalink:  ../5007AB3D.3010501@gmail.com/
Also on:    postgresql.org/message-id/5007AB3D.3010501@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: exclusion@gmail.com, ishii@postgresql.org, pgsql-general@postgresql.org, ringerc@ringerc.id.au, yi.codeplayer@gmail.com
  Subject: Re: main log encoding problem
  In-Reply-To: <5007AB3D.3010501@gmail.com>
  References: <1332187409-sup-4631@alvh.no-ip.org> <50067916.8010508@gmail.com> <5006D340.4000808@gmail.com> <20120719.081626.240539691760651172.t-ishii@sraoss.co.jp> <5007AB3D.3010501@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox