Re: psql and pset without any arguments

From: Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql and pset without any arguments
Date: 2013-06-29 15:05:22
Message-ID: 51CEF7B2.8070300@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le 29/06/2013 13:55, Erik Rijkers a écrit :
> On Sat, June 29, 2013 01:08, Gilles Darold wrote:
>> Here is a sample output:
>>
>> (postgres(at)[local]:5494) [postgres] > \pset
>> Output format is aligned.
>> Border style is 2.
>> Expanded display is used automatically.
>> Null display is "NULL".
>> Field separator is "|".
>> Tuples only is off.
>> Title is unset.
>> Table attributes unset.
>> Line style is unicode.
>> Pager is used for long output.
>> Record separator is <newline>.
>> (postgres(at)[local]:5494) [postgres] >
>>
> +1
>
> This seems handy. Maybe it could be improved
> a bit with the keyboard shortcuts prefixed, like so:
>
> (postgres(at)[local]:5494) [postgres] > \pset
> \a Output format is aligned.
> \x Expanded display is used automatically.
> \f Field separator is "|".
> \t Tuples only is off.
> \C Title is unset.
> \T Table attributes unset.
> Border style is 2.
> Line style is unicode.
> Null display is "NULL".
> Pager is used for long output.
> Record separator is <newline>.
>
>
> So that it also serves a reminder on how to subsequently
> change them

My first though was to print something like \set output, but why not
reuse the original code/output when \pset is used ?

This second choice has three main advantages :

* Information shown is the same everywhere
* Backward compatibility with \pset output
* Avoid code redundancy

About shortcut I'm agree with Pavel that it is less readable and already
in the help, \? is the big reminder :-)

Regards,

--
Gilles Darold
http://dalibo.com - http://dalibo.org

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-06-29 15:06:29 Re: New regression test time
Previous Message Fabrízio de Royes Mello 2013-06-29 14:05:38 Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements