pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ryoga Yoshida <bt23yoshidar@oss.nttdata.com>
To: pgsql-hackers@lists.postgresql.org
Subject: Bug fix in vacuumdb --buffer-usage-limit xxx -Z
Date: Thu, 21 Sep 2023 10:44:49 +0900
Message-ID: <08930c0b541700a5264e5fbf3a685f5a@oss.nttdata.com> (raw)

Hi,

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.

Ryoga Yoshida

Attachments:

v1-0001-bug-fix-in-vacuumdb-buffer-usage-limit-Z.patch (text/x-diff, 593B) download diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c index f03d5b1c6c..57355639c0 100644 --- a/src/bin/scripts/vacuumdb.c +++ b/src/bin/scripts/vacuumdb.c @@ -964,6 +964,13 @@ prepare_vacuum_command(PQExpBuffer sql, int serverVersion, appendPQExpBuffer(sql, "%sVERBOSE", sep); sep = comma; } + if (vacopts->buffer_usage_limit) + { + Assert(serverVersion >= 160000); + appendPQExpBuffer(sql, "%sBUFFER_USAGE_LIMIT '%s'", sep, + vacopts->buffer_usage_limit); + sep = comma; + } if (sep != paren) appendPQExpBufferChar(sql, ')'); }

view thread (8+ messages)  latest in thread

Message-ID: <08930c0b541700a5264e5fbf3a685f5a@oss.nttdata.com>
Permalink:  ../08930c0b541700a5264e5fbf3a685f5a@oss.nttdata.com/
Also on:    postgresql.org/message-id/08930c0b541700a5264e5fbf3a685f5a@oss.nttdata.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: bt23yoshidar@oss.nttdata.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Bug fix in vacuumdb --buffer-usage-limit xxx -Z
  In-Reply-To: <08930c0b541700a5264e5fbf3a685f5a@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox