Re: psql \G command -- send query and output using extended format

From: "Dawid Kuroczko" <qnex42(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql \G command -- send query and output using extended format
Date: 2008-04-03 14:49:21
Message-ID: 758d5e7f0804030749j152ab2aer5616f107d528157e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Thu, Apr 3, 2008 at 4:35 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Dawid Kuroczko" <qnex42(at)gmail(dot)com> writes:
> > The idea of \G command is to perform the query, but with printing
> > query results using extended table output format.
>
> Seems a bit useless --- if you prefer \x format, wouldn't you prefer it
> all the time? Or at least often enough that the toggling command is
> fine? I'm dubious that this is worth eating up a command letter for.

No, the point is that I usually have mixed queries -- ones which are
most comfortably viewed in normal format (many not-so-long rows),
and ones which are best viewed expanded (little rows, many columns).

Alternating between formats using "\x" is, at least for me, a bit
cumbersome: usually _after_ I wrote a query I realize "it would
look more readable in expanded format", which is a bit too late.
So I run the query, ctrl+c, \x, rerun the query... and forget to
turn expanded mode off afterwards.

I think that ability to decide about the format after the query,
not before, can be quite useful especially when writing ad-hoc
queries. Incidentally "\g" and "\G" is also used more or less
similarily by our dolphin-loving friends -- which doesn't help
using "\G" for other things.

Regards,
Dawid

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-04-03 14:55:39 Re: modules
Previous Message Hell, Robert 2008-04-03 14:45:30 GUC parameter cursors_tuple_fraction

Browse pgsql-patches by date

  From Date Subject
Next Message Bernd Helmle 2008-04-03 14:49:43 Re: psql command aliases support
Previous Message Hell, Robert 2008-04-03 14:45:30 GUC parameter cursors_tuple_fraction