Re: psql \G command -- send query and output using extended format - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: psql \G command -- send query and output using extended format
Date
Msg-id 200804031607.m33G7sL23552@momjian.us
Whole thread Raw
In response to Re: psql \G command -- send query and output using extended format  ("Dawid Kuroczko" <qnex42@gmail.com>)
Responses Re: psql \G command -- send query and output using extended format  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: psql \G command -- send query and output using extended format  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Dawid Kuroczko wrote:
> On Thu, Apr 3, 2008 at 4:35 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > "Dawid Kuroczko" <qnex42@gmail.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.

It seems more helpful if there were \x option to use extended format
only when the output is too wide.  TODO already has:
       o Add auto-expanded mode so expanded output is used if the row         length is wider than the screen width.
         Consider using auto-expanded mode for backslash commands like \df+.


--  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: Peter Eisentraut
Date:
Subject: Re: modules
Next
From: "Brendan Jurd"
Date:
Subject: Re: printTable API (was: Show INHERIT in \du)