pgbench - refactor init functions with buffers

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема pgbench - refactor init functions with buffers
Дата
Msg-id alpine.DEB.2.21.1910220826570.15559@lancre
обсуждение исходный текст
Ответы Re: pgbench - refactor init functions with buffers  (Dilip Kumar <dilipbalaut@gmail.com>)
Список pgsql-hackers
Hello,

While developing pgbench to allow partitioned tabled, I reproduced the 
string management style used in the corresponding functions, but was 
pretty unhappy with that kind of pattern:

     snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ...)

However adding a feature is not the place for refactoring.

This patch refactors initialization functions so as to use PQExpBuffer 
where appropriate to simplify and clarify the code. SQL commands are 
generated by accumulating parts into a buffer in order, before executing 
it. I also added a more generic function to execute a statement and fail 
if the result is unexpected.

-- 
Fabien.
Вложения

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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: pgbench - refactor init functions with buffers