Re: [HACKERS] \h tab-completion
От
Michael Paquier
Тема
Re: [HACKERS] \h tab-completion
Дата
Msg-id
CAB7nPqQxBna=N=NhfcbTVkiUB9v0-mvcdO3X-q91U003knPC7w@mail.gmail.com
Ответ на
Re: [HACKERS] \h tab-completion (Beena Emerson)
Список
Дерево обсуждения
[HACKERS] \h tab-completion Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] \h tab-completion Beena Emerson <memissemerson@gmail.com>
Re: [HACKERS] \h tab-completion Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] \h tab-completion Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] \h tab-completion Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] \h tab-completion Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Re: [HACKERS] \h tab-completion David Steele <david@pgmasters.net>
Re: [HACKERS] \h tab-completion Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] \h tab-completion Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] \h tab-completion Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] \h tab-completion Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] \h tab-completion Beena Emerson <memissemerson@gmail.com>
On Wed, Jan 25, 2017 at 3:03 PM, Beena Emerson wrote:
> I think the following change in tab-complete.c would do the trick.
>
> - else if (Matches1("ALTER"))
> + else if (TailMatches1("ALTER"))
Nope. This change breaks a bunch of subcommands, take for example
ALTER TABLE foo ALTER, which would be completed to all the potential
objects of ALTER commands with your patch, but in this case for
example we just need to look at the column names, CONSTRAINT and
COLUMN. CREATE is not part of any subcommands so that's easy to see it
work with \h. What I think you should do is making the code path of
\\h smarter with some exceptions by using TailMatchesCS2() for ALTER.
There is as well the case of DROP commands that should be treated by
the way.
--
Michael
В списке pgsql-hackers по дате отправления
От: Michael Paquier
Дата: