Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ur5RL-0008JO-5l for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2013 12:00:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ur5RK-0007br-GV for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2013 12:00:10 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ur5RI-0007bG-Qm for pgsql-hackers@postgresql.org; Mon, 24 Jun 2013 12:00:08 +0000 Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ur5RF-0000eN-Ag for pgsql-hackers@postgresql.org; Mon, 24 Jun 2013 12:00:07 +0000 Received: by mail-la0-f48.google.com with SMTP id lx15so10216692lab.35 for ; Mon, 24 Jun 2013 05:00:03 -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=gYeTjztS+Zh9TZQ9/XbaLjgPAinZ4DWbHBxF2SnLAL8=; b=qUIHNpioCsH95gawyoBcrHftbfrXsrSXUBCVRdADTob5zjALyhPpTVlRu6BioLE0Yv fs0c9lEwoBQ+SMyGaE3FSybA/9cZww0/x2b5iLkDZSg+xh3uRio2M8zhQw1PB7cECKlF QHhV6c4Eu3HjDklRXomN7D8yh2c/ccPMCzVLPqPBTLMDumKWmWzFnZtyaYZoW6f2HH9/ novIwqGF3LAXBvwkOLqlDNHZS6do5LAyjZnJ/76zDwwGuP3HGbOPpe6KkkK6QepsJKg0 PQ97Z9pwWBFfF71k8MLe24ndQ22meKyl+pKRU6UXt68xmp1lyJR9iVeUAgfpcr7nVgJ8 8aoQ== X-Received: by 10.112.58.135 with SMTP id r7mr12870854lbq.89.1372075203675; Mon, 24 Jun 2013 05:00:03 -0700 (PDT) Received: from [1.0.0.7] ([213.132.90.61]) by mx.google.com with ESMTPSA id p10sm6537772lap.8.2013.06.24.05.00.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 05:00:02 -0700 (PDT) Message-ID: <51C834C0.7010200@gmail.com> Date: Mon, 24 Jun 2013 16:00:00 +0400 From: Alexander Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Noah Misch CC: Tom Lane , pgsql-hackers , Magnus Hagander , Andrew Dunstan Subject: Re: BUG #7493: Postmaster messages unreadable in a Windows console References: <20130124161954.GA2448@tornado.leadboat.com> <5101A1C4.3020407@dunslane.net> <5107656C.1050400@gmail.com> <28316.1359471244@sss.pgh.pa.us> <20130130015155.GD3524@tornado.leadboat.com> <5108B6E1.9070503@gmail.com> <20130210210259.GA7401@tornado.leadboat.com> <511C8E11.7090407@gmail.com> <20130214225957.GA5626@tornado.leadboat.com> <5124BAC0.4060006@gmail.com> <20130623165359.GB782173@tornado.leadboat.com> In-Reply-To: <20130623165359.GB782173@tornado.leadboat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.7 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hello Noah, Thanks for your work, your patch is definitely better. I agree that this approach much more generic. 23.06.2013 20:53, Noah Misch wrote: > The attached revision fixes all above points. Would you look it over? The > area was painfully light on comments, so I added some. I renamed > pgwin32_toUTF16(), which ceases to be a good name now that it converts from > message encoding, not database encoding. GetPlatformEncoding() became unused, > so I removed it. (If we have cause reintroduce the exact same concept later, > GetTTYEncoding() would name it more accurately.) Yes, the patch works for me. I have just a little question about pgwin32_message_to_UTF16. Do we need to convert SQL_ASCII through UTF8 or should SQL_ASCII be mapped to 20127 (US-ASCII (7-bit))? > What should we do for the back branches, if anything? Fixes for garbled > display on consoles and event logs are fair to back-patch, but users might be > accustomed to the present situation for SQL_ASCII databases. Given the low > incidence of complaints and the workaround of using logging_collector, I am > inclined to put the whole thing in master only. I thought that the change could be a first step to the PosgreSQL log encoding normalization. Today the log may contain messages with different encodings (we had a long discussion a year ago: http://www.postgresql.org/message-id/5007C399.6000405@gmail.com) Now the new function GetMessageEncoding allows to convert all the messages consistently. If the future log encoding fix will be considered as important enough to be backported, then this patch should be backported too. Thanks again! Best regards, Alexander -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers