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

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Include schema-qualified names in publication error messages.
Date: 2026-04-29 11:11:17
Message-ID: CAFiTN-sCtP0eqpL7O-9o3MWyPDqUX6OX8fh_2_OWmLTLR9X4Yg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 29, 2026 at 4:08 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> On Wed, Apr 29, 2026 at 9:28 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> >
> > On Tue, Apr 28, 2026 at 9:39 PM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> > >
> > > 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);
> > >
> >
> > How about having a dedicated function to return the fully qualified
> > relation name you want, which can then substitute the single %s.
> >
> > e.g.
> > errmsg(errormsg, get_qualified_relname(targetrel)), ...
>
> Yeah that makes sense. I will change this.

--
Regards,
Dilip Kumar
Google

Attachment Content-Type Size
v2-0001-Include-schema-qualified-names-in-publication-err.patch application/octet-stream 7.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2026-04-29 11:29:26 Re: Support logical replication of DDLs, take2
Previous Message Matthias van de Meent 2026-04-29 10:49:24 Re: Startup process deadlock: WaitForProcSignalBarriers vs aux process