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 17:49:19
Message-ID: 200804241749.m3OHnJZ01072@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Gregory Stark wrote:
> "Bruce Momjian" <bruce(at)momjian(dot)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(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 Brendan Jurd 2008-04-24 17:59:47 Re: [GENERAL] I think this is a BUG?
Previous Message Tom Lane 2008-04-24 17:46:22 Re: [GENERAL] I think this is a BUG?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2008-04-24 17:56:54 Re: Sun Studio on Linux spinlock patch
Previous Message Bruce Momjian 2008-04-24 17:44:27 Re: 64-bit CommandIds