Re: Proposed patch - psql wraps at window width - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Proposed patch - psql wraps at window width
Date
Msg-id 200804251426.m3PEQcR20040@momjian.us
Whole thread Raw
In response to Re: Proposed patch - psql wraps at window width  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Proposed patch - psql wraps at window width  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
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.

I haven't heard any new ideas of how to resolve this issue in the past
few hours so I will throw out two new ideas.

Have a 'format=auto' mode that does aligned/wrapped/expanded, but only
for screen output --- file/pipe would still use aligned.  And have
'format=wrapped' affect file/pipe by requiring the user to specify the
width, or use a default of 72.

Another idea is to require the user to specify the file/pipe output
width when they define format=wrapped, e.g. format=wrapped:75.  If they
don't specify the width, 'wrapped' doesn't affect file/pipe.  (Perhaps
the width controls screen width too.)  (That is effectively what \pset
columns does, but this is more integrated.)

I have heard why people want 'wrapped' to affect file/pipe output, but I
have not heard a clear explanation of why people don't want that.  I
personally think that having the screen width affect the width of
file/pipe is odd, but if the user specifies the width, it seems fine to
me.  What is the objection?

--  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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: MERGE Specification
Next
From: Alvaro Herrera
Date:
Subject: Re: Proposed patch - psql wraps at window width