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

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Roger Leigh <rleigh(at)codelibre(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Roger Leigh <rleigh(at)debian(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unicode UTF-8 table formatting for psql text output
Date: 2009-08-27 14:03:26
Message-ID: 20090827140326.GB11213@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Roger Leigh escribió:
> On Tue, Aug 25, 2009 at 10:32:50PM -0400, Alvaro Herrera wrote:
> > Roger Leigh escribió:
> >
> > > An updated copy of the patch is attached.
> >
> > Did you give expanded output a look? (\x) I find it a bit weird that
> > the first line shows a single-pixel wide line but the subsequent ones
> > are thicker.
>
> Yes, it's just due to the fact that the middle lines are using a
> thicker line character, while the top and bottom lines are thin.
> This can easily be changed to be e.g. all thin.

Yeah, I think expanded output should use the same char for all lines.

> > BTW I think you should also look at multiline fields,
> >
> > a │ b
> > ━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> > 4 │ some text
> > : and some more
> > : and then some
> > (1 filas)
> >
> > And wrapped:
> >
> > alvherre=# select * from foo;
> > a │ b
> > ━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> > 5 │ En un lugar de la Mancha, de cuyo nombre no quiero acordarme, no ha mucho
> > ; tiempo que vivía un hidalgo
> > (1 fila)
>
> I initially left these exactly the same as for ASCII (the ':' and ';'
> usage). However, it's quite possible to make it use other characters.
> We could use the same lines, or two, three or four dashed lines
> ('╎' and '╏', or ┆' and '┇' or '┊' and '┋').

This works for me (say ╎ for newline-separated strings and ┊ for wrapped
output).

> The wrapping code also appears slightly broken anyway, since
> continuation lines don't get '|' printed for subsequent blank columns
> on the same line:

Yeah ... maybe there's a point to this, or maybe it's just a bug -- I
don't know.

> I also see in the code that under some circumstances (curr_nl_line), a
> '+' is used instead of a space when printing table headers, but I
> haven't been able to trigger this yet. We could also use dashed
> horizontal rules here.

Hmm, can't say I know what's this about.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Michel Pouré 2009-08-27 14:05:26 Re: MySQL Compatibility WAS: 8.5 release timetable, again
Previous Message Robert Haas 2009-08-27 13:58:42 Re: 8.5 release timetable, again