On Thu, 2005-08-25 at 13:53 +0000, Greg Sabino Mullane wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Tom Lane asked:
>
> >> o Improve psql's handling of multi-line queries
>
> > Uh, what's wrong with it? This item seems far too vague.
If you enter a multi-line query one line at a time, a subsequent
up-arrow will recover one line at a time; on the other hand, if you use
\e to edit a multi-line query, a subsequent up-arrow will recover the
whole query in one go. The latter behaviour would be nice in all cases.
An item not in the TODO list yet -- would anyone support including this
feature in psql?:
It would be nice if multi-line items lined up with their proper column
on output. This is what happens at the moment:
junk=# insert into xyz (name,address) values ('Joe Bloggs','1 Hindhead Villas,
junk'# Newport,
junk'# Gwent');
INSERT 230412518 1
junk=# select * from xyz;id | name | address
----+------------+----------------------------------- 1 | Joe Bloggs | 1 Hindhead Villas,
Newport,
Gwent
(1 row)
If there is more than one potential source column, things are even
worse:
junk=# select * from xyz;id | name | address | del_addr
----+------------+-----------------------------------+---------------------------------- 1 | Joe Bloggs | 1 Hindhead
Villas,
Newport,
Gwent | 2 The Laurels,
Swinkley,
XX3 5CX
(1 row)
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)
\a would turn this behaviour off.
Oliver Elphick