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

Stephen Frost <sfrost@snowman.net>

From: Stephen Frost <sfrost@snowman.net>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: D'Arcy Cain <darcy@druid.net>, pgsql-hackers@postgresql.org
Date: 2017-01-27T16:05:44Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. psql: Fix \gx when FETCH_COUNT is used

  2. psql: Add \gx command

* Alvaro Herrera (alvherre@2ndquadrant.com) wrote:
> 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).

Right, I agree it's the same thing, but (clearly), not everyone
discussing this realized that and, well, the \G-by-itself is a lot
easier for me, at least.  I have a really hard time not ending things
with a semi-colon. ;)

Thanks!;

Stephen;