From: Alexander Law <exclusion@gmail.com>
To: Alban Hertroys <haramrae@gmail.com>
Cc: 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: [GENERAL] main log encoding problem
Date: Thu, 19 Jul 2012 15:50:44 +0400
Message-ID: <5007F494.3030403@gmail.com> (raw)
In-Reply-To: <CAF-3MvPWk_xo=sUFvJqYrGrnh4G-rps67rn_-SoEMvCvygymug@mail.gmail.com>
References: <5007AB3D.3010501@gmail.com>
<20120719.162426.57507866406108945.t-ishii@sraoss.co.jp>
<5007C399.6000405@gmail.com>
<20120719.172805.690055013563911415.t-ishii@sraoss.co.jp>
<5007C802.3060007@gmail.com>
<CAF-3MvPWk_xo=sUFvJqYrGrnh4G-rps67rn_-SoEMvCvygymug@mail.gmail.com>
> I like Craig's idea of adding the client encoding to the log lines. A
> possible problem with that (I'm not an encoding expert) is that a log
> line like that will contain data about the database server meta-data
> (log time, client encoding, etc) in the database default encoding and
> database data (the logged query and user-supplied values) in the
> client encoding. One option would be to use the client encoding for
> the entire log line, but would that result in legible meta-data in
> every encoding?
I think then we get non-human readable logs. We will need one more tool
to open and convert the log (and omit excessive encoding specification
in each line).
> It appears that the primarly here is that SQL statements and
> user-supplied data are being logged, while the log-file is a text file
> in a fixed encoding.
Yes, and in in my opinion there is nothing unusual about it. XML/HTML
are examples of a text files with fixed encoding that can contain
multi-language strings. UTF-8 is the default encoding for XML. And when
it's not good enough (as Tatsou noticed), you still can switch to another.
> Perhaps another solution would be to add the ability to log certain
> types of information (not the core database server log info, of
> course!) to a database/table so that each record can be stored in its
> own encoding?
> That way the transcoding doesn't have to take place until someone is
> reading the log, you'd know what to transcode the data to (namely the
> client_encoding of the reading session) and there isn't any issue of
> transcoding errors while logging statements.
I don't think it would be the simplest solution of the existing problem.
It can be another branch of evolution, but it doesn't answer the
question - what encoding to use for the core database server log?
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, haramrae@gmail.com, ishii@postgresql.org, pgsql-general@postgresql.org, ringerc@ringerc.id.au, yi.codeplayer@gmail.com
Subject: Re: [GENERAL] main log encoding problem
In-Reply-To: <5007F494.3030403@gmail.com>
References: <5007AB3D.3010501@gmail.com> <20120719.162426.57507866406108945.t-ishii@sraoss.co.jp> <5007C399.6000405@gmail.com> <20120719.172805.690055013563911415.t-ishii@sraoss.co.jp> <5007C802.3060007@gmail.com> <CAF-3MvPWk_xo=sUFvJqYrGrnh4G-rps67rn_-SoEMvCvygymug@mail.gmail.com> <5007F494.3030403@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