Improve errmsg for publication membership

First seen: 2026-06-03 05:10:00+00:00 · Messages: 2 · Participants: 2

Latest Update

2026-06-04 · claude-opus-4-6

Technical Analysis: Improve errmsg for Publication Membership

Core Problem

This is a minor grammatical consistency fix in PostgreSQL's error message infrastructure. Two error messages in the logical replication publication subsystem use the phrase "is already member of" rather than the grammatically correct "is already a member of". The missing indefinite article "a" creates an inconsistency with all other member of error messages throughout the PostgreSQL source tree.

The affected messages are emitted when a user attempts to add a relation or schema to a publication that already contains it — i.e., duplicate membership errors in CREATE/ALTER PUBLICATION DDL commands.

Architectural Context

These error messages reside in the publication management code (likely src/backend/commands/publicationcmds.c or related files). PostgreSQL's logical replication system allows publications to contain:

  1. Individual relations (tables)
  2. Entire schemas (added in PG 15)

When a user issues something like ALTER PUBLICATION pub ADD TABLE already_included_table, PostgreSQL raises an error. The wording of that error is what this patch corrects.

Why It Matters

While trivially small in scope, this patch touches on PostgreSQL's strong commitment to:

Proposed Solution

The patch (v1) simply inserts the article "a" in two errmsg() format strings:

/* Before */
errmsg("relation \"%s\" is already member of publication \"%s\"", ...)
errmsg("schema \"%s\" is already member of publication \"%s\"", ...)

/* After */
errmsg("relation \"%s\" is already a member of publication \"%s\"", ...)
errmsg("schema \"%s\" is already a member of publication \"%s\"", ...)

Risk Assessment

This is an extremely low-risk change:

Review Status

The patch received a positive review from Ewan, who confirmed:

This is the type of trivial fix that a committer could apply directly without extended review cycles.