Re: main log encoding problem

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: exclusion(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org, ringerc(at)ringerc(dot)id(dot)au, yi(dot)codeplayer(at)gmail(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: main log encoding problem
Date: 2012-07-18 23:16:26
Message-ID: 20120719.081626.240539691760651172.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-hackers

> 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.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-07-19 01:42:45 Re: main log encoding problem
Previous Message Mike Wilson 2012-07-18 22:39:31 Re: BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2)

Browse pgsql-general by date

  From Date Subject
Next Message James W. Wilson 2012-07-18 23:38:45 Re: problem with dblink and "drop owned by"
Previous Message Bob Pawley 2012-07-18 22:20:32 Re: Trouble with NEW

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-07-19 01:42:45 Re: main log encoding problem
Previous Message Mike Wilson 2012-07-18 22:39:31 Re: BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2)