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 200804241749.m3OHnJZ01072@momjian.us
Whole thread Raw
In response to Re: Proposed patch - psql wraps at window width  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Proposed patch - psql wraps at window width  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Proposed patch - psql wraps at window width  (Gregory Stark <stark@enterprisedb.com>)
Re: Proposed patch - psql wraps at window width  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Gregory Stark wrote:
> "Bruce Momjian" <bruce@momjian.us> writes:
> 
> > 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.
> 
> Consider that this means that
> 
> psql -Pformat=wrapped -e 'select * from tab'
> 
> and
> 
> psql -Pformat=wrapped -e 'select * from tab' | more
> 
> will generate different output. That's bunk.

'ls' and 'ls | more' generate different outputs, and I have never heard
anyone call that "bunk".

Also, this does work:
psql -Pformat=wrapped -Pcolumns=70 -c "select repeat('a', 100)" test | more

If you want non-terminal output to wrap, you have to specify the width
--- that seems only reasonable because the file case really needs to
have the width specified.

> This is what I mean about trying to guess about what users expect. If you come
> up with complicated logic trying to anticipate every case and get it wrong
> users get angry.
> 
> If you just have simple rules which always apply then users understand they
> they need to override them for their corner cases.

You are going to need to find community members who support your
analysis if you want to make any headway in changing the patch.

--  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: Tom Lane
Date:
Subject: Re: [GENERAL] I think this is a BUG?
Next
From: "Brendan Jurd"
Date:
Subject: Re: [GENERAL] I think this is a BUG?