pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Alexander Law <exclusion@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Andrew Dunstan <andrew@dunslane.net>
Subject: Re: BUG #7493: Postmaster messages unreadable in a Windows console
Date: Mon, 24 Jun 2013 18:46:08 -0400
Message-ID: <20130624224608.GA839209@tornado.leadboat.com> (raw)
In-Reply-To: <51C834C0.7010200@gmail.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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

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



view thread (19+ messages)  latest in thread

Message-ID: <20130624224608.GA839209@tornado.leadboat.com>
Permalink:  ../20130624224608.GA839209@tornado.leadboat.com/
Also on:    postgresql.org/message-id/20130624224608.GA839209@tornado.leadboat.com

 · 

reply

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: noah@leadboat.com, exclusion@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org, magnus@hagander.net, andrew@dunslane.net
  Subject: Re: BUG #7493: Postmaster messages unreadable in a Windows console
  In-Reply-To: <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> <20130624224608.GA839209@tornado.leadboat.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