properly sizing attnums in pg_get_publication_tables
От
Ted Yu
Тема
properly sizing attnums in pg_get_publication_tables
Дата
Msg-id
CALte62watWE6moG8XbRWDU17wbG+hwE0adxp2tqP6OGLcRn6gg@mail.gmail.com
Список
Дерево обсуждения
properly sizing attnums in pg_get_publication_tables Ted Yu <yuzhihong@gmail.com>
Re: properly sizing attnums in pg_get_publication_tables Justin Pryzby <pryzby@telsasoft.com>
Hi,
I was looking at commit b7ae03953690a1dee455ba3823cc8f71a72cbe1d .
In `pg_get_publication_tables`, attnums is allocated with size `desc->natts`. However, since some columns may be dropped, this size may be larger than necessary.
When `nattnums > 0` is false, there is no need to allocate the `attnums` array. In the current formation, `attnums` should be freed in this scenario.
Please take a look at the patch which moves the allocation to inside the `if (nattnums > 0)` block.
Thanks
В списке pgsql-hackers по дате отправления
От: Zhang Mingli
Дата: