Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYEVQ-0000Pa-Rh for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jan 2017 16:08:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cYEVP-0004fQ-Ua for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jan 2017 16:08:35 +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 1cYEU0-000363-5v for pgsql-hackers@postgresql.org; Mon, 30 Jan 2017 16:07:08 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cYETw-0004fQ-KO for pgsql-hackers@postgresql.org; Mon, 30 Jan 2017 16:07:07 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id A94565F794; Mon, 30 Jan 2017 11:06:03 -0500 (EST) Date: Mon, 30 Jan 2017 11:06:03 -0500 From: Stephen Frost To: "David G. Johnston" Cc: Tom Lane , Pavel Stehule , Christoph Berg , Daniel Verite , PostgreSQL Hackers Subject: Re: One-shot expanded output in psql using \G Message-ID: <20170130160603.GF9812@tamriel.snowman.net> References: <20170127132737.6skslelaf4txs6iw@msg.credativ.de> <74e7fd23-f5a9-488d-a8c4-1e0da674b27c@manitou-mail.org> <20170130101424.fo4knpn4blaohazk@msg.df7cb.de> <20170130134608.GA9812@tamriel.snowman.net> <20170130150458.GC9812@tamriel.snowman.net> <24326.1485789276@sss.pgh.pa.us> <20170130153532.GE9812@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ppZQYoiDbpnT+URU" Content-Disposition: inline In-Reply-To: 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:53:10 up 205 days, 17:17, 3 users, load average: 0.09, 0.13, 0.13 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 --ppZQYoiDbpnT+URU Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable David, * David G. Johnston (david.g.johnston@gmail.com) wrote: > On Mon, Jan 30, 2017 at 8:35 AM, Stephen Frost wrote: > > * Tom Lane (tgl@sss.pgh.pa.us) wrote: > > > Stephen Frost writes: > > > > This particular bike-shedding really doesn't seem to be terribly us= eful > > > > or sensible, to me. \gx isn't "consistent" or "descriptive", frank= ly. > > > > > > Why not? To me it reads as "\g with an x option". The "x" refers to > > > the implied "\x", so it's not an arbitrary choice at all. > > > > That's not how '\dx' works, as I pointed out, so I don't see having the > > second character being 'x' to imply "\x mode" makes sense. >=20 > It makes perfect sense ... it just not something that we've had the option > to do before (no, I haven't tried to figure out if we've missed an > opportunity or two here). For my 2c, at least, I think we have.. I could certainly see it as very useful to have expanded output for \d and various \d sub-commands. How are we going to get there today? I don't see us re-defining what \dx means.=20 With this, what we could do is define \D to be the same as \d but in expanded mode. For something like \dp, having a \Dp option could be pretty nice. > > without actual consistency across commands which take 'x' > > as a sub-command I don't see the 'descriptive' argument as holding much > > weight either > > =E2=80=8B. >=20 > Arguing that something is mnemonic doesn't require any precedence - though > one could wish for better uses of mnemonic naming choices for past and > future items. I can see the mnemonic argument, just not one based on some kind of consistency with what we've actually got implemented today. > In scripting uses of psql I could see wanting to use "\gx" and, say "\gn" > (i.e., always output in non-expanded mode) instead of ";" so that for any > given query I can specify the exact layout I care about and don't have to > jump through hoops to toggle \x back and forth. Ugh. I would *much* rather scripting be clear and set things up ahead of time instead of changing a would-be query-ending ';' into a backslash command to indicate the output format for the prior query. > Limiting consideration of the use-case of this feature to interactive use > is, IMHO, a mistake. In the copious use of psql scripting that I do I > would find both options I named above to be useful to directly and > concisely communicate the display intent of each query I execute. I'm afraid we might just have to disagree on our preferences for script writing then. In any case, as I said up-thread, using \G for this doesn't mean we couldn't make other \g options if people have a use-case for them. Thanks! Stephen --ppZQYoiDbpnT+URU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYj2RrAAoJEO1sijiDR2RVz6cP/jdxzZYJogLBfeLryBhh5hEb 87FAuMS3bEiKEBQPElKTvWBRA4ncQYXoi8APmbzNi6GK61/8tRbtrIejRZNCkOAz myrMBSWLwQatMwzR09BwzJFCCvvXe9DxG8+hM8hEUN6sIKQhZebT53NwxL9S5+zh 6alvqFSfmWluBx2WmC6MpHeBiuNu+rjO9+8UWijlOldEBjWYRjRb/qCjd3wcYBbs iqdfu2ICBo+8UOJ8hHFjyEZB9e97TkfyiddrLmoHgBZCQHSSusAxZtdvEhqTx+Ta C7mxeMpOXxTZbqgZ+9Wly8suRWhD2H0mMSTmE9A7lg9opTxvvUXG741/MC3+5Cnt TF0KaBRUpVpaM6zrappOgJ1WCa7/T2lM4cDO2Gx6HIZ+axry5HBgphgqYNbcqzj/ PAWY2Lx3JrIGLcQDaYflqIUggv/UcbiIpU4Zf+l6Wy/w/F4979COisu4z8K5HGFb Brm2R0xt4vqskk62nE7mSj6caY4vNSnKh0jCWl5HcJxkFb/9ysctyXuh4Xa9Ui7B ev2BE+DkTmKs5S+AgRxUhzso9P8kT1dXT0TG9qZN+gqYTnlJDpF1VFXblaYC51qY sRo6goLAuNfrDA2H4xOKgAxp3mFoDxvsgIn1c0y/z3OUA+Sa9R4szQzR7RjzCYGe 7UJCy3p3LC1eVBQVcd9/ =W3Uk -----END PGP SIGNATURE----- --ppZQYoiDbpnT+URU--