Обсуждение: BUG #1711: psql doesn't format nicely with newlines

Поиск
Список
Период
Сортировка

BUG #1711: psql doesn't format nicely with newlines

От
""
Дата:
The following bug has been logged online:

Bug reference:      1711
Logged by:
Email address:      david.tulloh@infaze.com.au
PostgreSQL version: 8.0.3
Operating system:   Debian Linux
Description:        psql doesn't format nicely with newlines
Details:

Printing fields with newline characters isn't handled well by psql.

select 'blah\nblah\nblah\nmore blah';
produces:
         ?column?
--------------------------
 blah
blah
blah
more blah
(1 row)

The column width appears to be the full width of the row, not compensating
for the new line characters.  It also loses the indenting, though this is
less important.

select 'blah\nblah\nblah\nmore blah', 'blah\nblah\nblah\nmore blah';
produces:
         ?column?         |         ?column?
--------------------------+--------------------------
 blah
blah
blah
more blah | blah
blah
blah
more blah
(1 row)

This one gets much harder to read:  The second column has been placed under
the first.  The table seperator is also in the wrong position.

What I expected is something like:
   ?column?   |   ?column?
--------------+--------------
 blah         | blah
 blah         | blah
 blah         | blah
 more blah    | more blah
(1 row)