Re: garbage in psql -l

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Roger Leigh <rleigh(at)codelibre(dot)net>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: garbage in psql -l
Date: 2009-11-24 22:43:00
Message-ID: 26269.1259102580@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Roger Leigh <rleigh(at)codelibre(dot)net> writes:
> On Tue, Nov 24, 2009 at 02:19:27PM -0500, Tom Lane wrote:
>> I wonder whether the most prudent solution wouldn't be to prevent
>> default use of linestyle=unicode if ~/.psqlrc hasn't been read.

> This problem is caused when there's a mismatch between the
> client encoding and the user's locale. We can detect this at
> runtime and fall back to ASCII if we know they are incompatible.

Well, no, that is *one* of the possible failure modes. I've hit others
already in the short time that the patch has been installed. The one
that's bit me most is that the locale environment seen by psql doesn't
necessarily match what my xterm at the other end of an ssh connection
is prepared to do --- which is something that psql simply doesn't have
a way to detect. Again, this is something that's never mattered before
unless one was really pushing non-ASCII data around, and even then it
was often possible to be sloppy.

I'd be more excited about finding a way to use linestyle=unicode by
default if it had anything beyond cosmetic benefits. But it doesn't,
and it's hard to justify ratcheting up the requirements for users to get
their configurations exactly straight when that's all they'll get for it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roger Leigh 2009-11-25 00:14:32 Re: garbage in psql -l
Previous Message KaiGai Kohei 2009-11-24 22:17:54 Re: SE-PgSQL patch review