Re: Distinguish publication exclusions in object addresses

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Distinguish publication exclusions in object addresses
Date: 2026-09-15 13:50:20
Message-ID: CALDaNm3MMGOX6y=Hv=OHu35Jmj1=fh=Woj8N5NzNZAbDSsh6ew@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 15 Sept 2026 at 16:05, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Tue, Sep 15, 2026 at 2:01 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> >
> > The attached v2 version patch has the changes for the same. This also
> > addresses Hou's comments from [1].
> >
>
> --- a/src/include/nodes/parsenodes.h
> +++ b/src/include/nodes/parsenodes.h
> @@ -2416,6 +2416,7 @@ typedef enum ObjectType
> OBJECT_POLICY,
> OBJECT_PROCEDURE,
> OBJECT_PUBLICATION,
> + OBJECT_PUBLICATION_EXCLUDED_REL,
>
> I was trying to evaluate whether the above change needs catversion
> bump and reached conclusion that it doesn't need one because we never
> store this enum on-disk as part of parse-trees. Do let me know if you
> or others thinks differently.
>
> *
> static ObjectAddress
> get_object_address_publication_rel(List *object,
> - Relation *relp, bool missing_ok)
> + Relation *relp, bool missing_ok,
> + bool pubrel_is_exclusion)
>
> It is better to use objtype here instead of boolean as we already use
> at few other places.
>
> *
> + if (!missing_ok)
> + {
> + if (pubrel_is_exclusion)
> + ereport(ERROR,
> + (errcode(ERRCODE_UNDEFINED_OBJECT),
> + errmsg("publication excluded relation \"%s\" from publication \"%s\"
> does not exist",
> + RelationGetRelationName(relation), pubname)));
> + else
> ereport(ERROR,
> (errcode(ERRCODE_UNDEFINED_OBJECT),
> errmsg("publication relation \"%s\" in publication \"%s\" does not exist",
> RelationGetRelationName(relation), pubname)));
>
> I think these messages are misleading because actually here the object
> type is wrong rather than object doesn't exist.
>
> Please find a top-patch for the above suggestions.

Thanks for the suggestion, here is an updated v3 merged version with
the fixes for the same. This patch also addresses Nisha's comments
from [1].

[1] - https://www.postgresql.org/message-id/CABdArM5AXL7xN2c7CnUYhUw-kRdMw0WUAxMXMeEjzDV91tVDEw%40mail.gmail.com

Regards,
Vignesh

Attachment Content-Type Size
v3-0001-Distinguish-publication-exclusions-in-object-addr.patch application/octet-stream 22.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-09-15 14:38:57 Re: add list of major features to the v19 release notes
Previous Message Rafia Sabih 2026-09-15 13:30:29 Re: Bypassing cursors in postgres_fdw to enable parallel plans