Re: psql expanded auto

From: Noah Misch <noah(at)leadboat(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql expanded auto
Date: 2011-11-04 11:34:33
Message-ID: 20111104113433.GA10071@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marti Raudsepp 2011-11-04 11:39:15 Re: IDLE in transaction introspection
Previous Message Florian Pflug 2011-11-04 11:15:56 Re: Term positions in GIN fulltext index