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

From Gregory Stark
Subject Re: Proposed patch - psql wraps at window width
Date
Msg-id 871w53bzsi.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Proposed patch - psql wraps at window width  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposed patch - psql wraps at window width  (Bryce Nesbitt <bryce2@obviously.com>)
List pgsql-patches
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Gregory Stark <stark@enterprisedb.com> writes:
>> Also, how would you suggest figuring the width to use for output going to a
>> file? ioctl is irrelevant in that case, imho it should just default to 80
>> columns if COLUMNS is unset.
>
> It would be a spectacularly awful idea for this patch to affect the
> output to a file at all.

It's a compromise of convenience over principle to allow the default output
format to vary but I would still want to have the same set of output formats
_available_ to me regardless of whether I'm redirecting to a file or not. Much
like ls -C is available even if you're redirecting to a file and -1 is
available if you're on a terminal.

It sucks to run a program, decide you want to capture that output and find you
get something else. It *really* sucks to find there's just no way to get the
same output short of heroic efforts.

I also have the converse problem occasionally. I run everything under emacs
and occasionally run into programs which default to awkward output formats.
Usually it's not too bad because it's still on a pty but the window width is a
particular one which confuses programs.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's RemoteDBA services!

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposed patch - psql wraps at window width
Next
From: Bryce Nesbitt
Date:
Subject: Re: Proposed patch - psql wraps at window width