Re: Bug fix in vacuumdb --buffer-usage-limit xxx -Z

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Bug fix in vacuumdb --buffer-usage-limit xxx -Z
Дата
Msg-id CAApHDvqRHeik_F8egXCQZXXnRgjj-Wg2rLsds1Kx-efv_1bYnA@mail.gmail.com
обсуждение исходный текст
Ответ на Bug fix in vacuumdb --buffer-usage-limit xxx -Z  (Ryoga Yoshida <bt23yoshidar@oss.nttdata.com>)
Ответы Re: Bug fix in vacuumdb --buffer-usage-limit xxx -Z  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
On Thu, 21 Sept 2023 at 13:45, Ryoga Yoshida
<bt23yoshidar@oss.nttdata.com> wrote:
> When --buffer-usage-limit option is specified, vacuumdb issues VACUUM or
> VACUUM ANALYZE command with BUFFER_USAGE_LIMIT option. Also if
> --buffer-usage-limit and -Z options are specified, vacuumdb should issue
> ANALYZE command with BUFFER_USAGE_LIMIT option. But it does not. That
> is, vacuumdb -Z seems to fail to handle --buffer-usage-limit option.
> This seems a bug.
>
> You can see my patch in the attached file and how it works by adding -e
> option in vacuumdb.

Thanks for the report and the patch. I agree this has been overlooked.

I also wonder if we should be escaping the buffer-usage-limit string
sent in the comment.  It seems quite an unlikely attack vector, as the
user would have command line access and could likely just use psql
anyway, but I had thought about something along the lines of:

$ vacuumdb --buffer-usage-limit "1MB'); drop database postgres;--" postgres
vacuumdb: vacuuming database "postgres"
vacuumdb: error: processing of database "postgres" failed: ERROR:
VACUUM cannot run inside a transaction block

seems that won't work, due to sending multiple commands at once, but I
think we should fix it anyway.

David



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

Предыдущее
От: shveta malik
Дата:
Сообщение: Re: Synchronizing slots from primary to standby
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Memory consumed by child SpecialJoinInfo in partitionwise join planning