RE: Distinguish publication exclusions in object addresses - Mailing list pgsql-hackers

From Zhijie Hou (Fujitsu)
Subject RE: Distinguish publication exclusions in object addresses
Date
Msg-id TY4PR01MB17718424B75122A8D12257A5694B92@TY4PR01MB17718.jpnprd01.prod.outlook.com
Whole thread
In response to Re: Distinguish publication exclusions in object addresses  (shveta malik <shveta.malik@gmail.com>)
Responses Re: Distinguish publication exclusions in object addresses
List pgsql-hackers
Hi,

On Wednesday, September 16, 2026 6:14 PM shveta malik <shveta.malik@gmail.com> wrote:
> On Wed, Sep 16, 2026 at 3:24 PM Zhijie Hou (Fujitsu)
> > On Wednesday, September 16, 2026 5:20 PM Manuel Reyes Bravo
> <manuelreyesbravo@gmail.com> wrote:
> > >     CREATE TABLE t2(a int);
> > >     CREATE SCHEMA s2; CREATE TABLE s2.t2(a int);
> > >     CREATE PUBLICATION pub FOR ALL TABLES EXCEPT (TABLE s2.t2);
> > >
> > >     SELECT pg_get_object_address('publication relation','{s2,t2}','{pub}');
> > >     ERROR:  "t2" is not a published relation of publication "pub"
> > >
> > > So the message says that "t2" is not a published relation of pub, while
> > > the catalog says that a t2 is.  They are different tables, and the user
> > > cannot tell which one the message is about.
> >
> > In this case, the user is explicitly passing s2.t2 as a parameter to get its
> > object address. In that context, it's pretty clear to me that t2 in the message
> > refers exactly to the object the user passed, I personally don't think it could
> > point to any other table.
> 
> I agree that there is no confusion in above case. But I also don't see
> any harm in having a schema-qualified name. It makes the message
> clearer. The cases like below can become more understandable with
> schema qualified name.

There is no harm, but it is not consistent with the other object
messages used here (e.g., they do not report schema-qualified names):

get_relation_by_qualified_name
get_object_address_attribute
get_object_address_attrdef
get_object_address_unqualified
get_object_address_type
...

So it does not look necessary to me to add it for our publication case.

The column list error message reports schema-qualified names because users can
specify multiple tables with the same name from different schemas, so it's
necessary there. But that's not our case.

Best Regards,
Zhijie Hou

pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: Distinguish publication exclusions in object addresses
Next
From: Etsuro Fujita
Date:
Subject: Re: Several issues with postgres_fdw stats import