pgsql: Fix vacuumdb to pass buffer-usage-limit with analyze-only mode

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix vacuumdb to pass buffer-usage-limit with analyze-only mode
Date: 2023-09-21 05:48:03
Message-ID: E1qjCXj-0054aF-7s@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix vacuumdb to pass buffer-usage-limit with analyze-only mode

ae78cae3b added the --buffer-usage-limit to vacuumdb to allow it to
include the BUFFER_USAGE_LIMIT option in the VACUUM command.
Unfortunately, that commit forgot to adjust the code so the option was
added to the ANALYZE command when the -Z command line argument was
specified.

There were no issues with the -z command as that option just adds
ANALYZE to the VACUUM command.

In passing adjust the code to escape the --buffer-usage-limit option
before passing it to the server. It seems nothing beyond a confusing
error message could become this lack of escaping as VACUUM cannot be
specified in a multi-command string.

Reported-by: Ryoga Yoshida
Author: Ryoga Yoshida, David Rowley
Discussion: https://postgr.es/m/08930c0b541700a5264e5fbf3a685f5a%40oss.nttdata.com
Backpatch-through: 16, where ae78cae3b was introduced.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5cfba1ad69c6d43184645419476f6cc62e5dd3c5

Modified Files
--------------
src/bin/scripts/vacuumdb.c | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2023-09-21 05:48:25 pgsql: Fix vacuumdb to pass buffer-usage-limit with analyze-only mode
Previous Message Michael Paquier 2023-09-20 04:37:26 pgsql: doc: Fix description of BUFFER_USAGE_LIMIT for VACUUM and ANALYZ