Re: wrapping in extended mode doesn't work well with default pager

From: Noah Misch <noah(at)leadboat(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Sergey Muraviov <sergey(dot)k(dot)muraviov(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Emre Hasegeli <emre(at)hasegeli(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: wrapping in extended mode doesn't work well with default pager
Date: 2014-06-12 01:34:02
Message-ID: 20140612013402.GB686905@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 11, 2014 at 08:59:34PM +0100, Greg Stark wrote:
> The leading space that you (ie Peter) are complaining about in:
>
> col | 1
> ----+--
> col | 2
>
> Is there because if the cell wrapped it would get an ellipsis (ie
> '...' but it's a single unicode character) in that column to indicate
> that it's wrapped. However we don't wrap headers so the only reason to
> change it is for the "old-ascii" linestyle:
>
> stark=***# select * from (values (1),(2)) as _ ("col
> col");
> stark"***#
> col | 1
> +col ;
> -----+-----
> col | 2
> +col ;
>
> Noah's complaint is about the space padding on the *right*. Ie
>
> stark=***# select * from (values ('foo'),('foo bar baz')) as _ ("col");
> col | foo
> <- This is the end of the line
> -----+--------------------------------------------------------------------------<-
> This is the end of the line
> col | foo bar baz
> <- This is the end of the line
>
> We didn't used to do that in expanded and I kind of agree it would be
> nice to avoid.

Based on the commit message and procedural history, I thought commit 6513633
was changing behavior solely for the combination of "\pset expanded" and
"\pset format wrapped". Peter's and my test cases show that it also changed
behavior for "\pset expanded" alone. That's a bug, unless someone sees to
argue that the new "\pset expanded" behavior is a desirable improvement in
spite of its origin as an accident. Altering an entrenched psql output format
is a big deal.

--
Noah Misch
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-06-12 02:16:53 Re: wrapping in extended mode doesn't work well with default pager
Previous Message Stephen Frost 2014-06-12 00:59:17 Re: API change advice: Passing plan invalidation info from the rewriter into the planner?