Skip site navigation (1) Skip section navigation (2)

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

From: "Dawid Kuroczko" <qnex42(at)gmail(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: psql \G command -- send query and output using extended format
Date: 2008-04-03 07:23:06
Message-ID: (view raw or whole thread)
Lists: pgsql-hackerspgsql-patches

Attached is a simple patch which adds a "\G" backslash command, that is
similar "\g" command.  The difference is that "\G" prints results using
extended output format.  After the query the format is reset to the original

In other words command like:
   SELECT * FROM pg_stat_activity\G
is similar to doing:
   \x on
   SELECT * FROM pg_stat_activity\g
   \x on or off -- depending on the original state.

Rationale: switching format using "\x" for duration of single query I find
a bit uncomfortable.  This is similar to "\g file" which is one-shot version
of "\o file" command.


Attachment: psql-G-cmd.patch
Description: application/octet-stream (5.4 KB)


pgsql-hackers by date

Next:From: Dave PageDate: 2008-04-03 08:12:32
Subject: Re: Patch queue -> wiki (was varadic patch)
Previous:From: Magnus HaganderDate: 2008-04-03 07:12:58
Subject: Re: modules

pgsql-patches by date

Next:From: Bernd HelmleDate: 2008-04-03 08:34:56
Subject: Re: psql command aliases support
Previous:From: Volkan YAZICIDate: 2008-04-03 06:18:31
Subject: Re: Configurable Penalty Costs for Levenshtein

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group