Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 90AE1F6332B; Thu, 19 Jul 2012 08:51:08 -0300 (ADT) Received: from mail-lb0-f174.google.com ([209.85.217.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SrpG3-00027j-O5; Thu, 19 Jul 2012 11:51:08 +0000 Received: by lbbgm6 with SMTP id gm6so3487686lbb.19 for ; Thu, 19 Jul 2012 04:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=yQ0dwt11gTgR2RuGsv85nUOK7YXqx2f1Bung7fcSruw=; b=wMf0rbQd/6sSIIHtJhxEkSZY7oPrye5/pnWsRyhcSnrPmAHB+DMJMwFVdoj9Phxtz4 wIcPAHGgi7AV8UiIch/SZ+6hkSc6G1k7NHKofiqO1pB7kOYNPsrtp7VLLIyuQzwkVIha B1yULUgtVHEtiyfYE6sDTWb5HBS77W7CKSuLbS5Jz7sQzAAr1KDPkkJE7OpNNG48B/wC oH3TFOfRPiJm6Vkfi7ddI/JcVSd+8S7Lqeun6h0QyvgObU+dnsk+6qNh6KE5JgqKk1Pf MeG+iKpCGkEiOcxuYxYLY4GsGrqA1b+GiPLkZbTOnzAFEJ5P1caMuQANSTs8n0/8OChb BfzQ== Received: by 10.152.131.37 with SMTP id oj5mr1802048lab.14.1342698650112; Thu, 19 Jul 2012 04:50:50 -0700 (PDT) Received: from [1.0.0.7] ([94.138.26.200]) by mx.google.com with ESMTPS id fy10sm1840611lab.0.2012.07.19.04.50.45 (version=SSLv3 cipher=OTHER); Thu, 19 Jul 2012 04:50:48 -0700 (PDT) Message-ID: <5007F494.3030403@gmail.com> Date: Thu, 19 Jul 2012 15:50:44 +0400 From: Alexander Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Alban Hertroys CC: Tatsuo Ishii , pgsql-general@postgresql.org, ringerc@ringerc.id.au, yi.codeplayer@gmail.com, pgsql-bugs@postgresql.org Subject: Re: [GENERAL] main log encoding problem 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201207/167 X-Sequence-Number: 33643 > 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?