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

From Michael Paquier
Subject Re: IF (NOT) EXISTS in psql-completion
Date
Msg-id CAB7nPqRY1B++XJ26Mb+AUJxZQhS_1qWMi+MOWqJTDUBKXuuGTw@mail.gmail.com
Whole thread Raw
In response to Re: IF (NOT) EXISTS in psql-completion  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: IF (NOT) EXISTS in psql-completion  (Robert Haas <robertmhaas@gmail.com>)
Re: IF (NOT) EXISTS in psql-completion  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
List pgsql-hackers
On Mon, Sep 19, 2016 at 6:11 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> I am thinking so commit's description should be inside README

Horiguchi-san, your patch has some whitespace issues, you may want to
get a run with git diff --check. Here are some things I have spotted:
src/bin/psql/tab-complete.c:1074: trailing whitespace.
+        "MATERIALIZED VIEW",
src/bin/psql/tab-complete.c:2621: trailing whitespace.
+       COMPLETE_WITH_QUERY(Query_for_list_of_roles,

This set of patches is making psql tab completion move into a better
shape, particularly with 0001 that removes the legendary huge if-elif
and just the routine return immediately in case of a keyword match.
Things could be a little bit more shortened by for example not doing
the refactoring of the tab macros because they are just needed in
tab-complete.c. The other patches introduce further improvements for
the existing infrastructure, but that's a lot of things just for
adding IF [NOT] EXISTS to be honest.

Testing a bit, I have noticed that for example trying to after typing
"create table if", if I attempt to do a tab completion "not exists"
does not show up. I suspect that the other commands are failing at
that as well.
-- 
Michael



pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Use of SizeOfIptrData - is that obsolete?
Next
From: Heikki Linnakangas
Date:
Subject: Re: Refactoring speculative insertion with unique indexes a little