Re: Proposed patch - psql wraps at window width

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: 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 16:28:31
Message-ID: 200804241628.m3OGSVq08952@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Gregory Stark wrote:
> >> b) If you dump to a file it will still respect COLUMNS. This might be a bit
> >> weird since bash sets COLUMNS so your file width will be based on the size
> >> of your terminal. But people also do things like COLUMNS=120 psql -o f ...
> >
> > No, that will make the regression tests fail and it is hard to say why
> > you would want a file wrap width to match your screen width.
>
> Well you don't know where the pipe is going, it could be, for example, piped
> to a pager.
>
> I think the point is to keep the logic simple and not put in special cases
> based on assumptions of what users might do. If you have simple logic which
> doesn't do what the user expects in a corner case they understand and we can
> tell them to override it with \pset. If you have logic which does what they
> want normally but does something different sometimes based on criteria which
> they consider irrelevant then they get angry.

They can always do:

test=> \pset columns `echo $COLUMNS`
Target width for "wrap" format is 127.

My point is that we should do what most people _expect_, and the
majority of people here have stated they don't think wrap should modify
the file output _by_ _default_.

People who want a specific width for files should be setting their
desired width themselves, hence no need for the '79' default.

--
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 Martijn van Oosterhout 2008-04-24 16:28:40 Re: Index AM change proposals, redux
Previous Message Tom Lane 2008-04-24 16:28:16 Re: Proposed patch - psql wraps at window width

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2008-04-24 16:34:26 Re: Proposed patch - psql wraps at window width
Previous Message Tom Lane 2008-04-24 16:28:16 Re: Proposed patch - psql wraps at window width