Re: Include schema-qualified names in publication error messages.

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Include schema-qualified names in publication error messages.
Date: 2026-04-28 11:38:50
Message-ID: CAJpy0uB1eW7fU3_h6PuwLeGQpU0BAatyxqoH66-XgnSEFAD9gg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 28, 2026 at 4:34 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> Previously, error messages in check_publication_add_relation() only
> reported the relation name when a table could not be added to a
> publication or included in an EXCEPT clause. This could be ambiguous
> in databases where the same relation name exists in multiple schemas.
>

+1

> This patch updates these error messages to use schema-qualified names,
> improving the clarity of error reporting for CREATE PUBLICATION and
> ALTER PUBLICATION commands.
>
> This has been discussed on another thread [1]
>

The patch works well.

I think we can pull out
'get_namespace_name_or_temp(RelationGetNamespace(targetrel))' and
'RelationGetRelationName(targetrel)' into local variables to reduce
repetition and make the error paths a bit cleaner.

const char *nspname =
get_namespace_name_or_temp(RelationGetNamespace(targetrel));
const char *relname = RelationGetRelationName(targetrel);

thanks
Shveta

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2026-04-28 12:13:59 RE: [PATCH] Fix stale relation close in sequence synchronization
Previous Message Dilip Kumar 2026-04-28 11:28:49 Re: Proposal: Conflict log history table for Logical Replication