Re: One-shot expanded output in psql using \G

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: D'Arcy Cain <darcy(at)druid(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: One-shot expanded output in psql using \G
Date: 2017-01-27 15:42:31
Message-ID: 20170127154231.bdnejznebwcx2jkk@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost wrote:
> * Alvaro Herrera (alvherre(at)2ndquadrant(dot)com) wrote:

> > I think the suggestion is that \G replaces \g (which is the same thing
> > as the semicolon). So you would do this:
> >
> > SELECT * FROM table WHERE table_status = 1; % get a short list; normal output
> > SELECT * FROM table WHERE table_id = 123 \G % drill down to one ID
>
> Uh, I figured it was more like \g, which just re-runs the last query..
> As in, you'd do:
>
> table pg_proc; % blargh, I can't read it like this
> \G % ahh, much nicer

Sure, that's exactly the same thing. (You can omit the query in either
case which causes the previous query to be re-ran. \crosstabview,
\gexec etc also work like that).

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2017-01-27 15:46:56 Re: One-shot expanded output in psql using \G
Previous Message Haribabu Kommi 2017-01-27 15:35:48 Re: pg_hba_file_settings view patch