Re: Tech details - psql wraps at window width - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Tech details - psql wraps at window width
Date
Msg-id 200804260334.m3Q3YOf17339@momjian.us
Whole thread Raw
In response to Tech details - psql wraps at window width  (Bryce Nesbitt <bryce2@obviously.com>)
Responses Re: Tech details - psql wraps at window width
Re: Tech details - psql wraps at window width
List pgsql-hackers
Bryce Nesbitt wrote:
> But I agree it's not desirable to wrap file any sort of stream output, 
> by default, as that would break just about any script known to mankind.  
> Yet wrapping is a very user-friendly default for interactive terminals. 
> This is potentially an irreconcilable inconsistency.
> 
> I weigh in on the side of leaving it inconsistent, but making it really 
> easy to force the behavior you want with something like:
>    \pset format wrap [auto|nnn|off]
> 
> But that leaves a big hole: what does the setting in .psqlrc refer to?  
> Do we need separate controls in .psql?
> 
>    \pset format_terminal wrap [auto|nnn|off]
>    \pset format_terminal html
>    \pset format_stream wrap [auto|nnn|off]
>    \pset format_stream html
> 
> Where, on a stream, auto and off would have the same meaning, and \pset 
> format would set both?

Hey, I can work with this idea.  First, there really is no 'off' mode
for wrapped because that is aligned.  What we could do is to have:
\pset format wrapped display

affect only output to the screen, using the screen width, and:
\pset format wrapped nnn

affect output to the screen and file/pipes.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


pgsql-hackers by date:

Previous
From: "Brendan Jurd"
Date:
Subject: Re: Proposed Patch - LDAPS support for servers on port 636 w/o TLS
Next
From: Euler Taveira de Oliveira
Date:
Subject: ecpg localization