pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
REPACK ONLY is accepted but ignored
4+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2026-08-29 ec13f71049 f23de46e15  Disallow ONLY in REPACK commands.
* REPACK ONLY is accepted but ignored
@ 2026-08-27 15:11  Nathan Bossart <nathandbossart@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Nathan Bossart @ 2026-08-27 15:11 UTC (permalink / raw)
  To: pgsql-hackers

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.

-- 
nathan






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: REPACK ONLY is accepted but ignored
@ 2026-08-28 21:23  Nathan Bossart <nathandbossart@gmail.com>
  parent: Nathan Bossart <nathandbossart@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Nathan Bossart @ 2026-08-28 21:23 UTC (permalink / raw)
  To: pgsql-hackers

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.y index 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 ^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: REPACK ONLY is accepted but ignored
@ 2026-08-29 13:34  Antonin Houska <ah@cybertec.at>
  parent: Nathan Bossart <nathandbossart@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Antonin Houska @ 2026-08-29 13:34 UTC (permalink / raw)
  To: Nathan Bossart <nathandbossart@gmail.com>; +Cc: pgsql-hackers

Nathan Bossart <nathandbossart@gmail.com> wrote:

> 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.
> 
> diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
> index 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;
>                  }

At the moment, I can't think of other reason for using the 'vacuum_relation'
rule than the effort to replace both CLUSTER and VACUUM FULL. Unfortunately it
appears that the difference in the command arguments was missed.  What you
propose LGTM, thanks.

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: REPACK ONLY is accepted but ignored
@ 2026-08-29 15:25  Nathan Bossart <nathandbossart@gmail.com>
  parent: Antonin Houska <ah@cybertec.at>
  0 siblings, 0 replies; 4+ messages in thread

From: Nathan Bossart @ 2026-08-29 15:25 UTC (permalink / raw)
  To: Antonin Houska <ah@cybertec.at>; +Cc: pgsql-hackers

On Sat, Aug 29, 2026 at 03:34:42PM +0200, Antonin Houska wrote:
> At the moment, I can't think of other reason for using the 'vacuum_relation'
> rule than the effort to replace both CLUSTER and VACUUM FULL. Unfortunately it
> appears that the difference in the command arguments was missed.  What you
> propose LGTM, thanks.

Committed, thanks for looking.

-- 
nathan






^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2026-08-29 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27 15:11 REPACK ONLY is accepted but ignored Nathan Bossart <nathandbossart@gmail.com>
2026-08-28 21:23 ` Nathan Bossart <nathandbossart@gmail.com>
2026-08-29 13:34   ` Antonin Houska <ah@cybertec.at>
2026-08-29 15:25     ` Nathan Bossart <nathandbossart@gmail.com>

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