pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
tab complete for explain SETTINGS
3+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2019-09-27 4b011cad27 268c4e9d4d  Add tab completion for EXPLAIN (SETTINGS) in psql
* tab complete for explain SETTINGS
@ 2019-09-27 02:20  Justin Pryzby <pryzby@telsasoft.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Justin Pryzby @ 2019-09-27 02:20 UTC (permalink / raw)
  To: pgsql-hackers; +Cc: Tomas Vondra <tomas.vondra@postgresql.org>

Here's to hoping this is the worst omission in v12.

Justin

Attachments:

v1-0001-tab-completion-for-explain-SETTINGS.patch (text/x-diff, 1.1K) download From e21f58504e5006de9766fe586550b59167e00ffd Mon Sep 17 00:00:00 2001 From: Justin Pryzby <pryzbyj@telsasoft.com> Date: Thu, 26 Sep 2019 21:12:26 -0500 Subject: [PATCH v1] tab completion for explain (SETTINGS) missed at ea569d64ac7174d3fe657e3e682d11053ecf1866 --- src/bin/psql/tab-complete.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index c1add9e..73f4a4b 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -2943,8 +2943,8 @@ psql_completion(const char *text, int start, int end) */ if (ends_with(prev_wd, '(') || ends_with(prev_wd, ',')) COMPLETE_WITH("ANALYZE", "VERBOSE", "COSTS", "BUFFERS", - "TIMING", "SUMMARY", "FORMAT"); - else if (TailMatches("ANALYZE|VERBOSE|COSTS|BUFFERS|TIMING|SUMMARY")) + "TIMING", "SUMMARY", "FORMAT", "SETTINGS"); + else if (TailMatches("ANALYZE|VERBOSE|COSTS|BUFFERS|TIMING|SUMMARY|SETTINGS")) COMPLETE_WITH("ON", "OFF"); else if (TailMatches("FORMAT")) COMPLETE_WITH("TEXT", "XML", "JSON", "YAML"); -- 2.7.4
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: tab complete for explain SETTINGS
@ 2019-09-27 03:18  Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>
  parent: Justin Pryzby <pryzby@telsasoft.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tatsuro Yamada @ 2019-09-27 03:18 UTC (permalink / raw)
  To: Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers; +Cc: Tomas Vondra <tomas.vondra@postgresql.org>

On 2019/09/27 11:20, Justin Pryzby wrote:
> Here's to hoping this is the worst omission in v12.
> 
> Justin
> 

Hi Justin,

I share my test result of your patch.

I used two commits REL_12_RC1 and Head, and got a Hunk below:

#REL_12_RC1 (17822c0e4f5ab8093e78f665c9e44766ae648a44)
=============================
$ patch -p1 <v1-0001-tab-completion-for-explain-SETTINGS.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/bin/psql/tab-complete.c
Hunk #1 succeeded at 2886 (offset -57 lines).
=============================

#Head (fbfa5664882c9b61428266e6fb0d48b0147c421a)
=============================
$ patch -p1 <v1-0001-tab-completion-for-explain-SETTINGS.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file src/bin/psql/tab-complete.c
Hunk #1 succeeded at 2940 (offset -3 lines).
=============================


Anyway, I tested the patch and it looks fine. :)

#Test result of tab-completion on Head
=============================
# explain (
ANALYZE   BUFFERS   COSTS     FORMAT    SETTINGS  SUMMARY   TIMING    VERBOSE

# explain (s
settings  summary

# explain (settings ON ) select * from pg_class;
                          QUERY PLAN
-------------------------------------------------------------
  Seq Scan on pg_class  (cost=0.00..16.95 rows=395 width=265)
  Settings: geqo_threshold = '10'
(2 rows)
=============================


Thanks,
Tatsuro Yamada







^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: tab complete for explain SETTINGS
@ 2019-09-27 03:55  Michael Paquier <michael@paquier.xyz>
  parent: Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2019-09-27 03:55 UTC (permalink / raw)
  To: Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>; +Cc: Justin Pryzby <pryzby@telsasoft.com>; pgsql-hackers; Tomas Vondra <tomas.vondra@postgresql.org>

On Fri, Sep 27, 2019 at 12:18:17PM +0900, Tatsuro Yamada wrote:
> Anyway, I tested the patch and it looks fine. :)

Thanks Justin and Yamada-san.  The order of the options in the list to
display and in the check did not match the order of the documentation,
which is the intention here, so fixed and committed this way.

(The list of options displayed would be alphabetically ordered for the
completion but it is good to keep the code consistent with the docs,
this makes easier future checks when adding new options).
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-09-27 03:55 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 02:20 tab complete for explain SETTINGS Justin Pryzby <pryzby@telsasoft.com>
2019-09-27 03:18 ` Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>
2019-09-27 03:55   ` Michael Paquier <michael@paquier.xyz>

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