November 20th, 2013 by depesz | Tags: , , , , , , | 4 comments »
Did it help? If yes - maybe you can help me? Donate BTC to 19zPa5diT2LZqGtTi8f8bfApLn8rw9zBHx

On 19th of November, Fujii Masao committed patch:

Add tab completion for \pset in psql.
 
Pavel Stehule, reviewed by Ian Lawrence Barwick

psql, my favorite database client has (at the moment) 16 different formatting related options set by \pset command.

Some of these, have their shortcut versions (\x, \a, \t …), but not all.

Additionally – I think that:

\pset format unaligned

is more readable than

\a

And that doesn't even mention that \a is a toggle, and not setter.

Anyway – this new patch, by Pavel, adds simple, yet very useful thing – tab completion.

Now, instead of typing:

\pset format aligned

I can simply

\ps<tab>for<tab>a<tab>

to get the same thing.

If you think that's just a convenience – sure. It is. But it also saves me some time by avoiding typos. And that's a great thing. Thanks Pavel.

  1. 4 comments

  2. # Andreas
    Nov 20, 2013

    It is all these small things which make psql to by far best database client I have used.

  3. # Luca Veronese
    Nov 20, 2013

    Hi,

    is there a good tutorial about psql?
    I’ve always used it sparingly preferring pgAdmin but I probably missed something.

  4. Nov 20, 2013

    @Luca:
    not that I know. Did you read my earlier blogpost about command line tools?

  5. Nov 20, 2013

    @Luca: what I know only documentation http://www.postgresql.org/docs/9.3/static/app-psql.html

    A basic work is very simply – you should to know a few commands: \? \q \l \dt \dt+ \df \c \d \sf ^r ^a ^e and read documentation once. It is very strong in combination with bash.

Leave a comment