Re: Proposed patch - psql wraps at window width

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, 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-25 03:49:54
Message-ID: 200804250349.m3P3nsC24076@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2008-04-25 04:08:15 Re: Proposed patch - psql wraps at window width
Previous Message Joshua D. Drake 2008-04-25 03:40:54 Re: Proposed patch - psql wraps at window width