Re: [HACKERS] IF (NOT) EXISTS in psql-completion - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject Re: [HACKERS] IF (NOT) EXISTS in psql-completion
Date
Msg-id 20170203.171712.150614683.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] IF (NOT) EXISTS in psql-completion  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: [HACKERS] IF (NOT) EXISTS in psql-completion  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Hello. This is the new version of this patch. 

- Rebased to the current master (555494d) PUBLICATION/SUBSCRIPTION stuff conflicted.

- Fix a bug of CREATE INDEX(0012-Simplify-completion-for-CREATE-INDEX.patch). CREATE INDEX ON no longer gets a
suggestionof "ON".
 

- Added logging feature (0018-Debug-output-of-psql-completion.patch)
 This might be suitable to be a separate patch. psql completion code is defficult to debug when it is uncertain what
linedid a suggestion. This patch allows completion logs to psql log, which is activated by -L option.
 
 psql -L <logfile> <dbname>
 And the logs like the following will be printed.
 | completion performed at tab-complete.c:1146 for "do"

- OR REPLACE suggestion (0019-Add-suggestion-of-OR-REPLACE.patch)

At Wed, 1 Feb 2017 09:42:54 +0100, Pavel Stehule <pavel.stehule@gmail.com> wrote in
<CAFj8pRAHCwdwe+NRTQ9JrtMO2OdUWtp1demmv_jGBU2tRRs-CQ@mail.gmail.com>
> 2017-02-01 9:37 GMT+01:00 Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp
> the content of my last mail is a copy my mail from end of December.
> Probably lot of changes there.

Thanks for reposting.

> > > 2. tab complete doesn't work well if I am manually writing "create index
> > > on" - second "ON" is appended - it is a regression
> >
> > I'll fix it in the version.
> >
> > > I didn't find any other issues -
> > >
> > > note: not necessary to implement (nice to have) - I miss a support for OR
> > > REPLACE flag - it is related to LANGUAGE, TRANSFORMATION,  FUNCTION and
> > > RULE.

Hmm. This patch perhaps should not 'add a feature' (how about the
logging..). Anyway the last 19th patch does that.  The word
removal framework works well for this case.

After all, this patch is so large that I'd like to attach them as
one compressed file. The content of the file is the following.


0001-Refactoring-tab-complete-to-make-psql_completion-cod.patch - Just a refactoring of psql_completion

0002-Make-keywords-case-follow-to-input.patch - The letter case of additional suggestions for   COMPLETION_WITH_XX
followsinput.
 

0003-Introduce-word-shift-and-removal-feature-to-psql-com.patch - A feature to ignore preceding words. And a feature to
remove  intermediate words.
 

0004-Add-README-for-tab-completion.patch - README

0005-Make-SET-RESET-SHOW-varialble-follow-input-letter-ca.patch
0006-Allow-complete-schema-elements-in-more-natural-way.patch
0007-Allow-CREATE-RULE-to-use-command-completion-recursiv.patch
0008-Allow-completing-the-body-of-EXPLAIN.patch
0009-Simpilfy-ALTER-TABLE-ALTER-COLUMN-completion.patch
0010-Simplify-completion-for-CLUSTER-VERBOSE.patch
0011-Simplify-completion-for-COPY.patch
0012-Simplify-completion-for-CREATE-INDEX.patch
0013-Simplify-completion-for-CREATE-SEQUENCE.patch
0014-Simplify-completion-for-DROP-INDEX.patch
0015-Add-CURRENT_USER-to-some-completions-of-role.patch
0016-Refactor-completion-for-ALTER-DEFAULT-PRIVILEGES.patch
0017-Add-suggestions-of-IF-NOT-EXISTS.patch - A kind of sample refctoring (or augmenting) suggestion code   based on
thenew infrastructure.
 

0018-Debug-output-of-psql-completion.patch - Debug logging for psql_completion (described above)

0019-Add-suggestion-of-OR-REPLACE.patch - Suggestion of CREATE OR REPLACE.


# I hear the footsteps of another conflict..

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [HACKERS] Non-deterministic behavior with floating point inparallel mode
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [HACKERS] Logical Replication and Character encoding