| От | Alvaro Herrera |
|---|---|
| Тема | Re: [patch] Proposal for \crosstabview in psql |
| Дата | |
| Msg-id | 20160407225517.GA612264@alvherre.pgsql обсуждение исходный текст |
| Ответ на | Re: [patch] Proposal for \crosstabview in psql ("Daniel Verite" <daniel@manitou-mail.org>) |
| Ответы |
Re: [patch] Proposal for \crosstabview in psql
|
| Список | pgsql-hackers |
Daniel Verite wrote: > > * In the "if (cont.cells[idx] != NULL && cont.cells[idx][0] != '\0')" > > block (line 497 in the attached), can't we do the same thing by using > > psprintf? > > In that block, we can't pass a cell contents as a valist and be done with > that cell, because duplicates of (col value,row value) may happen > at any iteration of the upper loop over PQntuples(results). Any cell really > may need reallocation unpredictably until that loop is done, whereas > psprintf starts by allocating a new buffer unconditionally, so it doesn't > look > to me like it could help to simplify that block. I messed with that code some more, as it looked unnecessarily complicated; please see attached and verify that it still behaves sanely. This needs those regression tests you promised. I tested a few cases and it seems good to me. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера