[PATCH] Fix errhint messages for REPACK (CONCURRENTLY) restrictions

First seen: 2026-05-12 23:19:13+00:00 · Messages: 4 · Participants: 3

Latest Update

2026-05-14 · claude-opus-4-6

Technical Analysis: Fix errhint Messages for REPACK (CONCURRENTLY) Restrictions

Core Problem

This patch addresses a cosmetic but user-facing consistency issue in PostgreSQL's error hint messages for the REPACK (CONCURRENTLY) command. The problem stems from commit 28d534e2ae0, which introduced restrictions for concurrent repack operations but contained two defects in the errhint() calls:

  1. Syntax inconsistency: The hint messages referenced REPACK CONCURRENTLY (without parentheses), while the actual SQL syntax and the corresponding errmsg() text in the same file use REPACK (CONCURRENTLY). This creates confusion for users who see a hint referring to a syntactically different command form than what they actually typed or what the error message references.

  2. Missing trailing period: The TOAST relations hint lacked a terminating period, violating PostgreSQL's established message style guidelines (see src/tools/pgindent/typedefs.list and the error message style guide in the documentation). PostgreSQL conventions require that hint messages end with a period.

Architectural Context

Why This Matters

While seemingly trivial, message consistency in PostgreSQL is architecturally significant for several reasons:

The Fix

The patch is straightforward:

  1. Changes "REPACK CONCURRENTLY""REPACK (CONCURRENTLY)" in all affected errhint() calls
  2. Adds missing trailing period to the TOAST relations hint
  3. Uses %s format specifier for the command name, improving translatability

Before:

errhint("REPACK CONCURRENTLY is not supported for TOAST relations")

After:

errhint("%s is not supported for TOAST relations.", "REPACK (CONCURRENTLY)")

This pattern (using %s for SQL keywords that should not be translated) is a well-established PostgreSQL convention that ensures translators don't accidentally translate or modify SQL syntax embedded in messages.

Design Decisions

The key design decision here is the use of %s formatting rather than simply hardcoding the corrected string. This is a deliberate choice that:

Risk Assessment

This is an extremely low-risk change — it modifies only string literals in error reporting paths, with no behavioral or logical changes. The fast turnaround from submission to commit (under 24 hours) reflects this low risk profile.