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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE
Дата
Msg-id 16996.1537484596@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE  (Andres Freund <andres@anarazel.de>)
Ответы Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2018-09-20 18:38:36 -0400, Tom Lane wrote:
>> hmmm ... but even with variadic, C's macro facility is so weak that
>> I'm not sure we can reimplement these with it.  What would the
>> expansion look like?

> There's a dirty hack to count arguments in vararg macros:
> https://groups.google.com/d/msg/comp.std.c/d-6Mj5Lko_s/5fW1bP6T3RIJ

Doesn't seem to help for this case.  What we really want is to expand
a given pattern once for each variadic argument, and I don't see how
to get there from here.

Although maybe I'm thinking too much inside-the-box.  The expansion
doesn't necessarily have to be identical to the code the macros
generate today.  In fact, that code is kinda bulky.  I wonder if
we could go over to something involving a variadic function, or
maybe an array of string-pointer constants?

            regards, tom lane


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE
Следующее
От: Peter Geoghegan
Дата:
Сообщение: On-disk compatibility for nbtree-unique-key enhancement