Re: Making tab-complete.c easier to maintain

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Making tab-complete.c easier to maintain
Дата
Msg-id 1011.1451406109@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Making tab-complete.c easier to maintain  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Making tab-complete.c easier to maintain  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Michael Paquier <michael.paquier@gmail.com> writes:
>> On Sun, Dec 20, 2015 at 6:24 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> 1. I think it would be a good idea to convert the matching rules for
>>> backslash commands too.  To do that, we'd need to provide a case-sensitive
>>> equivalent to word_match and the matching macros.  I think we'd also have
>>> to extend word_match to allow a trailing wildcard character, maybe "*".

> I am not really sure I follow much the use of the wildcard, do you
> mean to be able to work with the [S] extensions of the backslash
> commands which are not completed now?

But they are completed:

regression=# \dfS str<TAB>
string_agg          string_agg_transfn  strip
string_agg_finalfn  string_to_array     strpos

This is because of the use of strncmp instead of plain strcmp
in most of the backslash matching rules, eg the above case is
covered by
else if (strncmp(prev_wd, "\\df", strlen("\\df")) == 0)

I was envisioning that we'd want to convert this to something like
else if (TailMatchesCS1("\\df*"))
        regards, tom lane



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

Предыдущее
От: Boriss Mejias
Дата:
Сообщение: Re: Testing Postgresql 9.5 RC1 with Alfresco 5.0.d
Следующее
От: Andreas Karlsson
Дата:
Сообщение: COPY (... tab completion