Re: FUNC_MAX_ARGS benchmarks

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: FUNC_MAX_ARGS benchmarks
Дата
Msg-id 1521.1029274953@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: FUNC_MAX_ARGS benchmarks  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: FUNC_MAX_ARGS benchmarks
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> In fact, I now see that there was no such problem.  I do wonder why the
> 32 is there, though? Shouldn't it be 6 or something like that?

Whoever it was was too lazy to count accurately ;-)

I guess I'd vote for changing the code to be
sys = malloc(strlen(editorName) + strlen(fname) + 10 + 1);if (!sys)    return false;sprintf(sys, "exec '%s' '%s'",
editorName,fname);
 

(note the added quotes to provide a little protection against spaces
and such).  Then it's perfectly obvious what the calculation is doing.
I don't care about wasting 20-some bytes, but confusing readers of the
code is worth avoiding.
        regards, tom lane


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

Предыдущее
От: Sean Chittenden
Дата:
Сообщение: Re: Open 7.3 items
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: Temporary Views