From: Stephen Frost <sfrost@snowman.net>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Christoph Berg <christoph.berg@credativ.de>
Cc: Daniel Verite <daniel@manitou-mail.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: One-shot expanded output in psql using \G
Date: Mon, 30 Jan 2017 11:06:03 -0500
Message-ID: <20170130160603.GF9812@tamriel.snowman.net> (raw)
In-Reply-To: <CAKFQuwbrrKkkyN=5MRVW_ydf9SF5aC2XAO-+0zeubkSiQPwc9w@mail.gmail.com>
References: <20170127132737.6skslelaf4txs6iw@msg.credativ.de>
<74e7fd23-f5a9-488d-a8c4-1e0da674b27c@manitou-mail.org>
<20170130101424.fo4knpn4blaohazk@msg.df7cb.de>
<20170130134608.GA9812@tamriel.snowman.net>
<CAFj8pRDLr=exBc4QZg7POLZcGHNi539ibhVqmGzWctyPo0TZ7A@mail.gmail.com>
<20170130150458.GC9812@tamriel.snowman.net>
<24326.1485789276@sss.pgh.pa.us>
<20170130153532.GE9812@tamriel.snowman.net>
<CAKFQuwbrrKkkyN=5MRVW_ydf9SF5aC2XAO-+0zeubkSiQPwc9w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
David,
* David G. Johnston (david.g.johnston@gmail.com) wrote:
> On Mon, Jan 30, 2017 at 8:35 AM, Stephen Frost <sfrost@snowman.net> wrote:
> > * Tom Lane (tgl@sss.pgh.pa.us) wrote:
> > > Stephen Frost <sfrost@snowman.net> writes:
> > > > This particular bike-shedding really doesn't seem to be terribly useful
> > > > or sensible, to me. \gx isn't "consistent" or "descriptive", frankly.
> > >
> > > 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.
>
> 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.
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
> > .
>
> 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
Attachments:
signature.asc (application/pgp-signature, 818B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: sfrost@snowman.net, david.g.johnston@gmail.com, tgl@sss.pgh.pa.us, pavel.stehule@gmail.com, christoph.berg@credativ.de, daniel@manitou-mail.org
Subject: Re: One-shot expanded output in psql using \G
In-Reply-To: <20170130160603.GF9812@tamriel.snowman.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox