Re: TODO list comments - Mailing list pgsql-hackers

From Tom Lane
Subject Re: TODO list comments
Date
Msg-id 771.1124993019@sss.pgh.pa.us
Whole thread Raw
In response to Re: TODO list comments  (Oliver Elphick <olly@lfix.co.uk>)
Responses Re: TODO list comments  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Oliver Elphick <olly@lfix.co.uk> writes:
> It would be better to show the columns aligned (perhaps without showing
> separators for other columns so as not to give the impression that the
> other columns contain null or empty strings):

> junk=# select * from xyz;
>  id |    name    |              address              |             del_addr 
> ----+------------+-----------------------------------+----------------------------------
>   1 | Joe Bloggs | 1 Hindhead Villas,                | 2 The Laurels,
>                  | Newport,                          | Swinkley,
>                  | Gwent                             | XX3 5CX
> (1 row)

I think the above is unacceptable because it looks indistinguishable
from a valid but quite different dataset.  (No, the "1 row" doesn't make
it better; as soon as there's more than one row you can't tell what you
have.  And leaving out the first | doesn't help if all the columns are
multiline.)

It might be OK without any separators on the added lines, though:
id |    name    |              address              |             del_addr 
----+------------+-----------------------------------+---------------------------------- 1 | Joe Bloggs | 1 Hindhead
Villas,               | 2 The Laurels,                  Newport,                            Swinkley,
Gwent                              XX3 5CX
 
(1 row)

Or perhaps use a different separator:

junk=# select * from xyz;id |    name    |              address              |             del_addr 
----+------------+-----------------------------------+---------------------------------- 1 | Joe Bloggs | 1 Hindhead
Villas,               | 2 The Laurels,   +            + Newport,                          + Swinkley,   +            +
Gwent                            + XX3 5CX
 
(1 row)

Not sure how hard this would be to program, or what sort of overhead it
might impose to check for the case.  My recollection is that psql's
table-layout code is pretty slow and ugly already ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: TODO list comments
Next
From: "Jim C. Nasby"
Date:
Subject: Re: TODO questions