From: Nathan Bossart <nathandbossart@gmail.com>
To: pgsql-hackers@postgresql.org
Subject: Re: REPACK ONLY is accepted but ignored
Date: Fri, 28 Aug 2026 16:23:10 -0500
Message-ID: <apH8Pm8ZJ2Rchzwc@nathan> (raw)
In-Reply-To: <apBTsWGwkLXVh8Ow@nathan>
References: <apBTsWGwkLXVh8Ow@nathan>
On Thu, Aug 27, 2026 at 10:11:45AM -0500, Nathan Bossart wrote:
> The REPACK grammar accepts ONLY and a trailing * like VACUUM does, but it's
> neither documented nor handled in the REPACK code. From a v19 perspective,
> it might be best to just reject that syntax for now, but that does mean it
> won't be able to do everything VACUUM (FULL) can.
Bringing REPACK in line with its documentation looks pretty simple. This
is probably the way to go for v19, as proper support for ONLY and trailing
* seems to require more invasive changes.
inline patch 1: src/backend/parser/gram.y (+6/-6 lines) download inline-1.patchdiff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.yindex a33c3aaeeb2..2df39a48fc6 100644--- a/src/backend/parser/gram.y+++ b/src/backend/parser/gram.y@@ -12543,25 +12543,25 @@ CreateConversionStmt:
*****************************************************************************/
RepackStmt:
- REPACK opt_utility_option_list vacuum_relation USING INDEX name+ REPACK opt_utility_option_list qualified_name opt_name_list USING INDEX name
{
RepackStmt *n = makeNode(RepackStmt);
n->command = REPACK_COMMAND_REPACK;
- n->relation = (VacuumRelation *) $3;- n->indexname = $6;+ n->relation = makeVacuumRelation($3, InvalidOid, $4);+ n->indexname = $7;
n->usingindex = true;
n->params = $2;
$$ = (Node *) n;
}
- | REPACK opt_utility_option_list vacuum_relation opt_usingindex+ | REPACK opt_utility_option_list qualified_name opt_name_list opt_usingindex
{
RepackStmt *n = makeNode(RepackStmt);
n->command = REPACK_COMMAND_REPACK;
- n->relation = (VacuumRelation *) $3;+ n->relation = makeVacuumRelation($3, InvalidOid, $4);
n->indexname = NULL;
- n->usingindex = $4;+ n->usingindex = $5;
n->params = $2;
$$ = (Node *) n;
}
--
nathan
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com
Subject: Re: REPACK ONLY is accepted but ignored
In-Reply-To: <apH8Pm8ZJ2Rchzwc@nathan>
References: <apBTsWGwkLXVh8Ow@nathan> <apH8Pm8ZJ2Rchzwc@nathan>
* 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