Re: [HACKERS] garbage in psql -l

2009-11-26 Thread Roger Leigh
On Wed, Nov 25, 2009 at 11:34:35PM -0500, Tom Lane wrote: Roger Leigh rle...@codelibre.net writes: The following patch adds in an nl_langinfo(CODESET) check in addition to the existing client encoding check. I think the consensus is pretty clear that we should just set the default

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Peter Eisentraut
On tis, 2009-11-24 at 14:19 -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. More generally, it would probably be safer if we used linestyle=unicode only if the client encoding has been set

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Peter Eisentraut
On ons, 2009-11-25 at 00:14 +, Roger Leigh wrote: For the specific case here, where the locale is KOI8-R, we can determine at runtime that this isn't a UTF-8 locale and stay using ASCII. I'll be happy to send a patch in to correct this specific case. There is already a proposed patch to

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Peter Eisentraut
On tis, 2009-11-24 at 14:19 -0500, Tom Lane wrote: I think you're being overoptimistic to assume that that's going to eliminate the issue. It might patch things for Oleg's particular configuration; but the real problem IMO is that people are depending on ~/.psqlrc to set encoding/locale

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Magnus Hagander
On Tue, Nov 24, 2009 at 22:35, Tom Lane t...@sss.pgh.pa.us wrote: Oleg Bartunov o...@sai.msu.su writes: what's benefit of using linestyle=unicode ? I like old ASCII style for console. Well, I have to grant that it looks pretty spiffy on a unicode-enabled display.  Whether that's enough

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On tis, 2009-11-24 at 14:19 -0500, Tom Lane wrote: I think you're being overoptimistic to assume that that's going to eliminate the issue. It might patch things for Oleg's particular configuration; but the real problem IMO is that people are depending

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: FWIW, this patch also *completely* breaks the default windows installs, which will have the database in UTF-8 but there is *never* any UTF-8 support on the console (only UTF-16). Hmm ... so how do we work with utf-8 data in the database? That should

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Magnus Hagander
On Wed, Nov 25, 2009 at 15:41, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: FWIW, this patch also *completely* breaks the default windows installs, which will have the database in UTF-8 but there is *never* any UTF-8 support on the console (only UTF-16). Hmm

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Wed, Nov 25, 2009 at 15:41, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: FWIW, this patch also *completely* breaks the default windows installs, which will have the database in UTF-8 but there is *never* any

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Andrew Dunstan
On Wed, November 25, 2009 10:04 am, Tom Lane wrote: I'm now pretty well convinced that this patch is *not* worth the amount of pain it will cause if it's invoked by default, no matter what restrictions we try to place on that. We should just make the default be linestyle=ascii, period. +1

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Stefan Kaltenbrunner
Andrew Dunstan wrote: On Wed, November 25, 2009 10:04 am, Tom Lane wrote: I'm now pretty well convinced that this patch is *not* worth the amount of pain it will cause if it's invoked by default, no matter what restrictions we try to place on that. We should just make the default be

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Roger Leigh
On Wed, Nov 25, 2009 at 09:39:32AM -0500, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: On tis, 2009-11-24 at 14:19 -0500, Tom Lane wrote: I think you're being overoptimistic to assume that that's going to eliminate the issue. It might patch things for Oleg's particular

Re: [HACKERS] garbage in psql -l

2009-11-25 Thread Tom Lane
Roger Leigh rle...@codelibre.net writes: The following patch adds in an nl_langinfo(CODESET) check in addition to the existing client encoding check. I think the consensus is pretty clear that we should just set the default linestyle to ascii and not try to be cute with it. (I had already

[HACKERS] garbage in psql -l

2009-11-24 Thread Oleg Bartunov
Hi there, I have problem with CVS HEAD (noticed a week or so ago) - psql -l show garbage instead of -|+. Looks, like utf-8 symbols used instead that ascii characters. List of databases NameБ■┌ Owner Б■┌ Encoding Б■┌ Collation Б■┌

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Tom Lane
Oleg Bartunov o...@sai.msu.su writes: I have problem with CVS HEAD (noticed a week or so ago) - psql -l show garbage instead of -|+. Looks, like utf-8 symbols used instead that ascii characters. Hm, you only see it for -l and not for all tabular output? That's a bit strange.

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Oleg Bartunov
On Tue, 24 Nov 2009, Tom Lane wrote: Oleg Bartunov o...@sai.msu.su writes: I have problem with CVS HEAD (noticed a week or so ago) - psql -l show garbage instead of -|+. Looks, like utf-8 symbols used instead that ascii characters. Hm, you only see it for -l and not for all tabular output?

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Tom Lane
Oleg Bartunov o...@sai.msu.su writes: On Tue, 24 Nov 2009, Tom Lane wrote: Hm, you only see it for -l and not for all tabular output? That's a bit strange. yes, I'm surprising myself. Teodor has no problem, but he is under FreeBSD, while I use slackware linux. Here is ldd output. What's

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Oleg Bartunov
On Tue, 24 Nov 2009, Tom Lane wrote: Oleg Bartunov o...@sai.msu.su writes: On Tue, 24 Nov 2009, Tom Lane wrote: Hm, you only see it for -l and not for all tabular output? That's a bit strange. yes, I'm surprising myself. Teodor has no problem, but he is under FreeBSD, while I use

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Tom Lane
Oleg Bartunov o...@sai.msu.su writes: On Tue, 24 Nov 2009, Tom Lane wrote: What's your locale environment? (env | grep ^L would help.) LC_COLLATE=ru_RU.KOI8-R LANG=C LC_CTYPE=ru_RU.KOI8-R Hmm, I can duplicate the fact that psql -l uses utf8 characters (because it connects to the postgres

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Peter Eisentraut
On tis, 2009-11-24 at 21:32 +0300, Oleg Bartunov wrote: On Tue, 24 Nov 2009, Tom Lane wrote: Oleg Bartunov o...@sai.msu.su writes: On Tue, 24 Nov 2009, Tom Lane wrote: Hm, you only see it for -l and not for all tabular output? That's a bit strange. yes, I'm surprising myself.

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Oleg Bartunov
On Tue, 24 Nov 2009, Tom Lane wrote: Oleg Bartunov o...@sai.msu.su writes: On Tue, 24 Nov 2009, Tom Lane wrote: What's your locale environment? (env | grep ^L would help.) LC_COLLATE=ru_RU.KOI8-R LANG=C LC_CTYPE=ru_RU.KOI8-R Hmm, I can duplicate the fact that psql -l uses utf8

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Oleg Bartunov
On Tue, 24 Nov 2009, Peter Eisentraut wrote: On tis, 2009-11-24 at 21:32 +0300, Oleg Bartunov wrote: On Tue, 24 Nov 2009, Tom Lane wrote: Oleg Bartunov o...@sai.msu.su writes: On Tue, 24 Nov 2009, Tom Lane wrote: Hm, you only see it for -l and not for all tabular output? That's a bit

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Tom Lane
Oleg Bartunov o...@sai.msu.su writes: why 8.4 has no real problem ? Because we never tried to use utf8 table decoration before. This is collateral damage from Roger Leigh's recent patches. The problem is evidently that Oleg is depending on ~/.psqlrc to set client_encoding the way he wants it,

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Peter Eisentraut
On tis, 2009-11-24 at 21:55 +0300, Oleg Bartunov wrote: Seems like a mismatch between client encoding and actual locale environment. why 8.4 has no real problem ? Because table formatting with Unicode characters is a new feature. Anyway, that patch to set the client encoding

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: Anyway, that patch to set the client encoding automatically from the locale sounds even more useful now. I think you're being overoptimistic to assume that that's going to eliminate the issue. It might patch things for Oleg's particular configuration;

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Oleg Bartunov
On Tue, 24 Nov 2009, Tom Lane wrote: Oleg Bartunov o...@sai.msu.su writes: why 8.4 has no real problem ? Because we never tried to use utf8 table decoration before. This is collateral damage from Roger Leigh's recent patches. The problem is evidently that Oleg is depending on ~/.psqlrc to

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Tom Lane
Oleg Bartunov o...@sai.msu.su writes: what's benefit of using linestyle=unicode ? I like old ASCII style for console. Well, I have to grant that it looks pretty spiffy on a unicode-enabled display. Whether that's enough reason to risk breaking things for people with non-unicode-enabled

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Oleg Bartunov
On Tue, 24 Nov 2009, Tom Lane wrote: Oleg Bartunov o...@sai.msu.su writes: what's benefit of using linestyle=unicode ? I like old ASCII style for console. Well, I have to grant that it looks pretty spiffy on a unicode-enabled display. Whether that's enough reason to risk breaking things for

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Robert Haas
On Tue, Nov 24, 2009 at 4:49 PM, Oleg Bartunov o...@sai.msu.su wrote: On Tue, 24 Nov 2009, Tom Lane wrote: Oleg Bartunov o...@sai.msu.su writes: what's benefit of using linestyle=unicode ? I like old ASCII style for console. Well, I have to grant that it looks pretty spiffy on a

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Roger Leigh
On Tue, Nov 24, 2009 at 02:19:27PM -0500, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: Anyway, that patch to set the client encoding automatically from the locale sounds even more useful now. I think you're being overoptimistic to assume that that's going to eliminate the

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Tom Lane
Roger Leigh rle...@codelibre.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

Re: [HACKERS] garbage in psql -l

2009-11-24 Thread Roger Leigh
On Tue, Nov 24, 2009 at 05:43:00PM -0500, Tom Lane wrote: Roger Leigh rle...@codelibre.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.