Re: Proposed patch - psql wraps at window width

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Brendan Jurd" <direvus(at)gmail(dot)com>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>, "Bryce Nesbitt" <bryce2(at)obviously(dot)com>, <heikki(at)enterprisedb(dot)com>
Subject: Re: Proposed patch - psql wraps at window width
Date: 2008-04-24 22:35:33
Message-ID: 871w4u7ufe.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Bruce Momjian" <bruce(at)momjian(dot)us> writes:

> I am not excited about 'wrapped-interactive' and 'wrapped-all' formats.
> Do you have some other idea in mind?

Some other idea for the name of it? Not particularly. I like your later
suggestion of "auto". Perhaps just "wrapped" and "auto"?

> I can't think of any cases where we have one setting for interactive and
> another for all uses.

In general I don't like such things but it seems to be what you're trying to
do. And also what Tom seems to be yearning for when he says that it shouldn't
affect file output. And if we do it we should do it properly and not hobble
both modes.

Note that basing it on the window size ioctl doesn't actually dtrt either.
What you really want is for it to depend on isatty(). If isatty(fout) is true
then you want to try to take the interactive default even if the ioctl fails.

Trying to join the two decisions means that nobody will be happy. If you ssh
in you won't get wrapped format, if you redirect to a file and specify wrapped
format explicitly you'll be frustrated that you're still not getting it. And
if you do want those things so you \pset columns you'll find it starts doing
it even when you -f file.dmp -- which doesn't seem bad to me but it means it
isn't satisfying your desires.

> I do think we might be adding an 'auto' format the does
> aligned/wrapped/expanded based on the table width, but only for
> interactive use.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's On-Demand Production Tuning

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-04-24 22:38:11 Re: Proposed patch - psql wraps at window width
Previous Message Gregory Stark 2008-04-24 22:16:17 Re: Proposed patch - psql wraps at window width