From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Report the correct table in publication duplicate-table errors
Date: Wed, 25 Nov 2026 14:44:19 +0000
Message-ID: <E1xWEEN-00000000H3S-1tZ7@gemulon.postgresql.org> (raw)
Report the correct table in publication duplicate-table errors
When a table is listed explicitly and also reached through its
inheritance parent, CREATE/ALTER PUBLICATION reports "conflicting or
redundant WHERE clauses" or "conflicting or redundant column lists".
OpenTableList() reused the variable holding the explicitly named table
for each child it opened. As a result, the error could report a
different child (or the parent) instead of the table that was listed
twice. For example, with parent p and children c1 and c2, "FOR TABLE
c2, p WHERE (a > 0)" reported table "c1".
Use a separate variable for the opened child and report the
conflicting table in the error message.
Author: Vignesh C <vignesh21@gmail.com>
Discussion: https://www.postgresql.org/message-id/CALDaNm3vJ8QaHYZtqk+KbRomGWPYkAzxvWzyfs_=gnSVmyvW4g@mail.gmail...
Backpatch-through: 15
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/048c8725bf9aaa4ce14727509f22c7eda68269da
Modified Files
--------------
src/backend/commands/publicationcmds.c | 9 +++++----
src/test/regress/expected/publication.out | 10 ++++++++++
src/test/regress/sql/publication.sql | 8 ++++++++
3 files changed, 23 insertions(+), 4 deletions(-)
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-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi
Subject: Re: pgsql: Report the correct table in publication duplicate-table errors
In-Reply-To: <E1xWEEN-00000000H3S-1tZ7@gemulon.postgresql.org>
References: <E1xWEEN-00000000H3S-1tZ7@gemulon.postgresql.org>
* 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