Re: psql expanded auto - Mailing list pgsql-hackers

From Noah Misch
Subject Re: psql expanded auto
Date
Msg-id 20111104113433.GA10071@tornado.leadboat.com
Whole thread Raw
In response to Re: psql expanded auto  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: psql expanded auto
List pgsql-hackers
On Tue, Nov 01, 2011 at 06:22:47AM +0200, Peter Eisentraut wrote:
> I wrote:
> > I have often found myself wanting that psql automatically switch between
> > normal and \x mode depending on the width of the output.  Would others
> > find this useful?
> > 
> > Attached is a crude demo patch.  Enable with \pset expanded auto.
> 
> Here is a finalized patch for this.  The first hunk of the patch is the
> documentation change, so you can see there how it's supposed to work.
> Let me know what you think.

+1.  I'm anticipating liking this enough to put it in ".psqlrc".


Perhaps this message should change to just "Target width is 120.", since it now
applies to more than just the wrapped format:

[local] test=# \pset columns 120
Target width for "wrapped" format is 120.

Similarly, psql documentation for "\pset columns" and the COLUMNS environment
variable should note expanded auto in addition to the wrapped format.


For "\pset format wrapped", we only use $COLUMNS when the output is a tty.  I'm
thinking it's best, although not terribly important, to apply the same rule to
this feature.

Thanks,
nm


pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: Term positions in GIN fulltext index
Next
From: Marti Raudsepp
Date:
Subject: Re: IDLE in transaction introspection