Re: Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE
Дата
Msg-id 6546.1537561242@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE  (Thomas Munro <thomas.munro@enterprisedb.com>)
Ответы Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> On Fri, Sep 21, 2018 at 5:52 PM Andres Freund <andres@anarazel.de> wrote:
>> Here's a very quick-and-dirty implementation of this approach. Some very
>> very brief testing seems to indicate it works, although I'm sure not
>> perfectly.

> And here is a quick-and-dirty variadic COMPLETE_WITH(...).  Together:

I'm a bit inclined to get rid of the need for PP_NARG() by instead making
the macros add a trailing NULL argument, viz

#define TailMatches(...) \
  CheckTailMatchesFor(previous_words_count, previous_words, __VA_ARGS__, NULL)

This'd require (some of) the implementation functions to iterate over
their variadic arguments twice, the first time merely counting how many
there are.  But we aren't exactly concerned about max runtime performance
here, and the PP_NARG() thing seems like a crock that could easily blow
out compilation time on some compilers.

If people are OK with that design decision, I'm happy to assemble these
pieces and push it through.  I just had to add two more versions of
HeadMatchesN :-( so I'm feeling motivated to make something happen.

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Redundant psql tab-completion for CREATE PUBLICATION
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE