Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hH9ma-0002Fd-Gk for pgsql-bugs@arkaria.postgresql.org; Thu, 18 Apr 2019 16:21:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hH9mZ-0007Uc-3I for pgsql-bugs@arkaria.postgresql.org; Thu, 18 Apr 2019 16:21:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hH9mY-0007UD-OV for pgsql-bugs@lists.postgresql.org; Thu, 18 Apr 2019 16:21:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hH9mW-0002aj-9G for pgsql-bugs@lists.postgresql.org; Thu, 18 Apr 2019 16:21:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3IGKuuf012141; Thu, 18 Apr 2019 12:20:56 -0400 From: Tom Lane To: Alvaro Herrera cc: Eugene Podshivalov , Bruce Momjian , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15772: Some messages in log files are in ANSI encoding while server encoding is UTF8 In-reply-to: <20190418160116.GA13165@alvherre.pgsql> References: <20190418160116.GA13165@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 18 Apr 2019 12:01:16 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12139.1555604456.1@sss.pgh.pa.us> Date: Thu, 18 Apr 2019 12:20:56 -0400 Message-ID: <12140.1555604456@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > I suppose you have databases with the single-byte encoding amidst your > UTF8 ones. AFAIK the log file registers the log entries in the same > encoding that the database uses. Different databases can use different > encodings. > That's pretty broken, but it's how it is. Yeah, and it's not easy to improve on. If we tried to convert all log messages to the same encoding, which one would that be? (Please, no nonsense about UTF8 being a universal solution. The Japanese don't think so, for instance.) Also, what do you do if you get an encoding conversion failure? That's even before you get into implementation-dependent problems, like what to do early in process startup before the encoding conversion machinery is operational. A more realistic idea might be to have separate log files for different encodings, though that has a bunch of management issues to solve as well. regards, tom lane