Re: Proposed patch - psql wraps at window width

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "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-24 20:17:44
Message-ID: 87abjj6m8n.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Bruce Momjian" <bruce(at)momjian(dot)us> writes:

> I think the API in the patch is the best I am going to do to keep
> everyone happy --- 'wrapped' doesn't affect file/pipe output unless you
> also tell it the width you want. Most interactive users are going to
> set 'wrapped' and never set the width so it is automatically determined.

Aaah, I think that's the key to where we're going wrong.

Trying to use the columns logic to encode two separate decisions. "wrapped or
not wrapped" and "how wide".

I think this also clarifies Tom's objection. He's worried about people
configuring psql for interactive use and being surprised when their automated
scripts fail to parse the resulting output.

We do need a way to specifically request wrapped format, but if we want a way
to say "wrapped format only on a terminal" then we should have a mode for that
too.

But once we're in wrapped format we should stick to it and always follow the
same logic to determine the width.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's Slony Replication support!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2008-04-24 20:19:52 Re: Proposed patch - psql wraps at window width
Previous Message Bruce Momjian 2008-04-24 19:52:10 Re: Proposed patch - psql wraps at window width