| From: | Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Report the correct table in publication duplicate-table errors |
| Date: | 2026-11-25 14:44:19 |
| Message-ID: | E1xWEEN-00000000H3S-1tZ7@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/CALDaNm3vJ8QaHYZtqk+KbRomGWPYkAzxvWzyfs_=gnSVmyvW4g@mail.gmail.com
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(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Heikki Linnakangas | 2026-11-25 14:44:20 | pgsql: Report the correct table in publication duplicate-table errors |
| Previous Message | Álvaro Herrera | 2026-11-25 09:34:34 | pgsql: Adjust an error message to emphasize the inheritance relationshi |