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

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to