Re: Unicode UTF-8 table formatting for psql text output

From: Roger Leigh <rleigh(at)codelibre(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unicode UTF-8 table formatting for psql text output
Date: 2009-10-27 11:34:19
Message-ID: 20091027113419.GA3603@codelibre.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 26, 2009 at 11:33:40PM +0000, Roger Leigh wrote:
> On Mon, Oct 26, 2009 at 07:19:24PM -0400, Tom Lane wrote:
> > Roger Leigh <rleigh(at)codelibre(dot)net> writes:
> > > On Mon, Oct 26, 2009 at 01:33:19PM -0400, Tom Lane wrote:
> > >> Yeah. We can do what we like with the UTF8 format but I'm considerably
> > >> more worried about the aspect of making random changes to the
> > >> plain-ASCII output.
> >
> > > I checked (using strace)
> > > gnumeric (via libgda and gnome-database-properties)
> > > openoffice (oobase)
> >
> > Even if that were the entire universe of programs we cared about,
> > whether their internal ODBC logic goes through psql isn't really
> > the point here. What I'm worried about is somebody piping the
> > text output of psql into another program.
> >
> > > On a related note, there's something odd with the pager code.
> >
> > Hm, what platform are you testing that on?
>
> Debian GNU/Linux (unstable)
> linux 2.6.30
> eglibc 2.10.1
> libreadline6 6.0.5
> libncurses5 5.7
> gcc 4.3.4
>
> This is the trace of the broken write:
>
> 16206 write(1, " Name \342\224\202 Owner \342\224"..., 102) = 102
> 16206 write(1, "\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342
> \224"..., 256) = 256
> 16206 write(1, "\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\n", 18) = 18

Further tracing showed this to be a bug in the "util-linux" version of
"more" which had a static 256 byte line buffer. The above was a red
herring--it's writing to a pipe. I've sent a patch to fix this by
increasing the buffer size.

--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2009-10-27 12:04:07 Re: half OOT, plv8js group created ^^
Previous Message Dave Page 2009-10-27 11:07:35 Re: License clarification: BSD vs MIT