Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX94R-0007UJ-T3 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jan 2017 16:08:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cX94R-0003Hq-ER for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jan 2017 16:08:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cX932-0001hM-5J for pgsql-hackers@postgresql.org; Fri, 27 Jan 2017 16:06:48 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX92z-0007m6-6s for pgsql-hackers@postgresql.org; Fri, 27 Jan 2017 16:06:47 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 8DF6D5F794; Fri, 27 Jan 2017 11:05:44 -0500 (EST) Date: Fri, 27 Jan 2017 11:05:44 -0500 From: Stephen Frost To: Alvaro Herrera Cc: D'Arcy Cain , pgsql-hackers@postgresql.org Subject: Re: One-shot expanded output in psql using \G Message-ID: <20170127160544.GI9812@tamriel.snowman.net> References: <20170127153116.GF9812@tamriel.snowman.net> <20170127154231.bdnejznebwcx2jkk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="N1KpsBYai/tZitdI" Content-Disposition: inline In-Reply-To: <20170127154231.bdnejznebwcx2jkk@alvherre.pgsql> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 11:03:23 up 202 days, 17:27, 7 users, load average: 0.03, 0.07, 0.08 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -5.1 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --N1KpsBYai/tZitdI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: > Stephen Frost wrote: > > * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: >=20 > > > I think the suggestion is that \G replaces \g (which is the same thing > > > as the semicolon). So you would do this: > > >=20 > > > SELECT * FROM table WHERE table_status =3D 1; % get a short list; nor= mal output > > > SELECT * FROM table WHERE table_id =3D 123 \G % drill down to one ID > >=20 > > Uh, I figured it was more like \g, which just re-runs the last query.. > > As in, you'd do: > >=20 > > table pg_proc; % blargh, I can't read it like this > > \G % ahh, much nicer >=20 > 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; --N1KpsBYai/tZitdI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYi2/YAAoJEO1sijiDR2RVlgQQAMethKsJ0SMK7dipzCyHFc+9 QEq9FrOuEpKrx62EtPekBQIRGlMQAv6nnYt7UP+plU0x1+MulVRhFGuycoIUIMNA cxPY0A7hB5Uci1yI10mmiCMDpIYXlXeNAcEn2XFzMy1SJrehiGzWjt7mHutU+VEU Lh5Xnist83RpvKKQT8IAqUI6NUZcedNbTIoi5511eCgy++Xl9l7yliKyjqUcJuTS YI2efTtiHbMiGtG5uV5J9qt8y+7vGtKIDVheMwGDioFq84bQfMkrXoNcSNm8wewk CIlsqGZv/Yb+YPpcnHC53k2UJtm5cCgEmFRI0hPb2Yz8WIOhgKAEBS7Ax5eVs7An 0y6UtN83p32uVJoTFah7Tlg96VAXcTDZSDCghAje/nWXdhJmbi2eoxH4xZjVUeEv qDKvEFQW1bSk4G85KZxsV9VTSjSj7hOMSYXT4W9eWZcmL+hIybKaW4dyOmIK32L4 qDxpMi+uuf2WkuWVuAqOrevPOLB+LODy5NRmAAYKXR7jE+Jys0QEDhaIBCQq4hse eedcnDbqIi+KwrYhMZ1iEzN4Yxge1uw4vo4V7q7ehopWSVrO8HM62csSstE6HLo9 3a/jQvHF3Mgu56Nxb2SvXh0x6MYg8DSDIpCu+RMdnbM4kqqblaRJePCa7Gd1FSJq S+/HdGzBFGf/4b1FAZ2N =QCpX -----END PGP SIGNATURE----- --N1KpsBYai/tZitdI--