Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrFWg-0004JP-2E for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2013 22:46:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UrFWf-00062b-HL for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2013 22:46:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrFWd-000612-Cq for pgsql-hackers@postgresql.org; Mon, 24 Jun 2013 22:46:19 +0000 Received: from mail-qa0-f41.google.com ([209.85.216.41]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UrFWY-0002kw-SB for pgsql-hackers@postgresql.org; Mon, 24 Jun 2013 22:46:18 +0000 Received: by mail-qa0-f41.google.com with SMTP id f14so158844qak.7 for ; Mon, 24 Jun 2013 15:46:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent:x-gm-message-state; bh=quI4YBpWeBTW+bQFZtNXpBEq39NDVJmwlYgrXspEdCs=; b=HPDZxefpwLvXahF8IjZV/mHgYzJUrTUZ95v/RhCEfFYdN5tSQctX0GpJL2L3Lbzork mU2bHWY5KSKZPktmfMODBIpAdWvGcVf/8aKz25o7gDJ+n3oNLtnMLpzgnOjxsIh1v3ps KbPMktiIfVtFUjEWBSqaj1YMRUb8f7jxU+MeNpLKvpxW00jWlMVqkE0T29LAg+8cWaUI rjxA7+yO0gf3TIGRSZlyAP3c6dZ9xbiPpkGWu3zPgeSMnjzTa312lzfhMuenSnRIlgbU fpxcSU2z2YkwqGxNs43MpfxI7k5YjTBziDsI+lIOIOLA8RitJ25apgWoJTUHyV+CCbEv cOjQ== X-Received: by 10.224.182.79 with SMTP id cb15mr29550430qab.48.1372113972743; Mon, 24 Jun 2013 15:46:12 -0700 (PDT) Received: from tornado.leadboat.com (ip68-105-236-221.hr.hr.cox.net. [68.105.236.221]) by mx.google.com with ESMTPSA id r10sm22612209qeu.4.2013.06.24.15.46.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 24 Jun 2013 15:46:10 -0700 (PDT) Date: Mon, 24 Jun 2013 18:46:08 -0400 From: Noah Misch To: Alexander Law Cc: Tom Lane , pgsql-hackers , Magnus Hagander , Andrew Dunstan Subject: Re: BUG #7493: Postmaster messages unreadable in a Windows console Message-ID: <20130624224608.GA839209@tornado.leadboat.com> References: <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> <51C834C0.7010200@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <51C834C0.7010200@gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Gm-Message-State: ALoCoQmJ4rm47d9O3cgEZ0JXjrPvy8w8gxLDdYm20yZm/QKcS+78Ooidk7Nd678VNL0EZ37Rj1xY X-Pg-Spam-Score: -2.6 (--) 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 On Mon, Jun 24, 2013 at 04:00:00PM +0400, Alexander Law wrote: > 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))? Good question. SQL_ASCII is an awkward database encoding; it actually indicates ignorance about the significance of byte sequences in text. As a result, nothing we do here is likely to be delightful. I caused an error containing some LATIN2 bytes (SELECT * FROM "śmiać się") in an SQL_ASCII / LC_CTYPE=C database, and the result was decent, considering: the event log shows a question-mark-in-rhombus symbol for each of the non-ASCII bytes. Using CP20127 turned it into "6miaf sij". I don't have a great idea for improving on the existing hack. >> 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. I doubt that would prove to be back-patch material. -- Noah Misch EnterpriseDB http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers