Re: Proposed patch - psql wraps at window width

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Proposed patch - psql wraps at window width
Дата
Msg-id 200804250349.m3P3nsC24076@momjian.us
обсуждение исходный текст
Ответ на Re: Proposed patch - psql wraps at window width  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: Proposed patch - psql wraps at window width  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-hackers
Joshua D. Drake wrote:
> Bruce Momjian wrote:
> > We have discussed having a formatting mode where aligned output switches
> > to expanded output when the row is too wide.  One idea would be to
> > create an 'auto' mode that would display in aligned, or wrapped if that
> > doesn't fit, or expanded if that doesn't fit.
> > 
> > However, this idea really doesn't help us with the file/pipe idea.  One
> > crazy idea would be for formatting to take two values, like:
> > 
> >     \pset formatting wrapped aligned
> 
> IMO we should never wrap file or pipe output. Once it leaves psql, it 
> should be up to whatever you pushed it through (file/pipe/script) to 
> handle formatting.

Yes, I understand that argument, but the way we wrap values is something
an external tool is going to have great trouble duplicating.

For example, if I want to send wide psql output in email, right now I
just send it wide or use \x.  With 'wrapped' I can set it to 72 columns
and get something I can email to people.  I could copy it from my
screen, but if the output is more than a screen full it is much harder
to capture.  (Yea, I could use 'script', but that isn't for the novice,
and I have no idea how that would be done on Win32.)

We could go with wrap only handling interactive and then see what
feedback we get from the field.  For short output people can cut/paste
into files if they want wrapped output.  That would eliminate the need
for \pset columns.  We could just do ioctl() and check $COLUMNS.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Proposed patch - psql wraps at window width
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Proposed patch - psql wraps at window width