Re: [HACKERS] One-shot expanded output in psql using \G - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] One-shot expanded output in psql using \G
Date
Msg-id 20170127154231.bdnejznebwcx2jkk@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] One-shot expanded output in psql using \G  (Stephen Frost <sfrost@snowman.net>)
Responses Re: [HACKERS] One-shot expanded output in psql using \G  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Stephen Frost wrote:
> * Alvaro Herrera (alvherre@2ndquadrant.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



pgsql-hackers by date:

Previous
From: Haribabu Kommi
Date:
Subject: Re: [HACKERS] pg_hba_file_settings view patch
Next
From: "David G. Johnston"
Date:
Subject: Re: [HACKERS] One-shot expanded output in psql using \G