Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX8Vj-0005tI-KA for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jan 2017 15:32:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cX8Vj-0008Tu-1I for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Jan 2017 15:32:23 +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 1cX8Vh-0008TH-OT for pgsql-hackers@postgresql.org; Fri, 27 Jan 2017 15:32:21 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX8Vd-00074w-BG for pgsql-hackers@postgresql.org; Fri, 27 Jan 2017 15:32:21 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 45AEA5F794; Fri, 27 Jan 2017 10:31:16 -0500 (EST) Date: Fri, 27 Jan 2017 10:31:16 -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: <20170127153116.GF9812@tamriel.snowman.net> References: <8b8068d9-b218-06c6-6b98-8d7f1a365449@druid.net> <20170127152609.hsjdr5cetlxm47ke@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dJ/dmHtgGfJ1X++b" Content-Disposition: inline In-Reply-To: <20170127152609.hsjdr5cetlxm47ke@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: 10:30:06 up 202 days, 16:54, 7 users, load average: 0.02, 0.06, 0.11 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 --dJ/dmHtgGfJ1X++b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: > D'Arcy Cain wrote: >=20 > > I am a pretty heavy user of psql but I don't think that that would be so > > helpful. I assume you mean a new option, let's call it "\X" the causes= the > > next query to be expanded. I type "\X" then a query. I realize that I= made > > a mistake and have to redo the query so I have to type "\X" again. If I > > forget then I have to run the query yet again. >=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; normal = output > SELECT * FROM table WHERE table_id =3D 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 Thanks! Stephen --dJ/dmHtgGfJ1X++b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYi2fDAAoJEO1sijiDR2RVXWAP/jbH+6AlQQlf3Do+GwZpXJS1 3SDfHdpQ2BLMGJtzrTAi5wyibXA08dds3VIjsa26TXK/Ictwuijwv3gY8Dt+EYeH GwdtMAr3vSp08akKjWIbC+KGXIuI98npwHXVXd9vRCVvB6fML5wbjMGV2aX19ADK c0gz1cb0B10Hx3Fk2Lc63DGdmHSfAPRPEB32ZLkqRLmVz11Kc2tJLFs0svIW73OZ a6rVHqEKhl7+W0f7MxMB107hkPFEeCK78SH1/M5TSPAfb0I1907wR4FmFPStoyLP kZne4kNzGEqvzZRX/FXBr3K5vljKYXs56VnnmeND0tLwMGiY2saZaJqREe+LZq9Z ZZGGB6JMe7iqyAaot1f1rfVlsQj5U0NOFI4KN8gRtcTVpSasyB7ANoBgNlGCI6j5 daZiLIm95q0Mbwcx1LPoMN8MzU09JIEZV7ls75drU72MDBUsY8e/tZh65OcvlbhS w9cM9H8ZQqrZl+DI2btT4n1Fz4EgUrsjjtT/gaS78l0sIIfmksqKQMghZQP+fHy0 na+C+8WHlfv88khbKCHj72jQnrA2DJ/swX2fpKfQdz4293ScoOG28qk8JSGjcDdl hWtO5+9FfnUyV9Q+SnHPAA78pJbSVoOFnc1SyAOzC8trOgZuiqU0HrkSmLqAK8Tq 0tv0oCjDYm5id23+G1en =0bQu -----END PGP SIGNATURE----- --dJ/dmHtgGfJ1X++b--