Re: [HACKERS] pgbench - allow to store select results intovariables
Вложения
В списке pgsql-hackers по дате отправления:
| От | Fabien COELHO |
|---|---|
| Тема | Re: [HACKERS] pgbench - allow to store select results intovariables |
| Дата | |
| Msg-id | alpine.DEB.2.21.1811180851210.19159@lancre обсуждение исходный текст |
| Ответ на | Re: [HACKERS] pgbench - allow to store select results into variables (Alvaro Herrera <alvherre@2ndquadrant.com>) |
| Ответы |
Re: [HACKERS] pgbench - allow to store select results into variables
|
| Список | pgsql-hackers |
Hello Alvaro, >>> I think this patch's Command->lines would benefit from using PQExpBuffer >>> (or maybe StringInfo?) for the command string instead of open-coding >>> string manipulation and allocation. > > [...] Ok. >>> I'm not sure that Command->first_line is really all that useful. It >>> seems we go to a lot of trouble to keep it up to date. Isn't it easier >>> to chop Command->lines at the first newline when it is needed? >> >> Hmmm, it is needed quite often (about 12 times) to report errors, that would >> mean having to handle the truncation in many places, so I felt it was worth >> the trouble. > > Ok, as long as we don't repeat the work during script execution. Sure, the point of first_line is that it is computed once at parse time. Attached a v23 with PQExpBuffer for managing lines. I've also added a function to compute the summary first line, which handles carriage-return. -- Fabien.
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера