Re: Review items for EXCEPT TABLE publication

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Review items for EXCEPT TABLE publication
Date: 2026-09-10 13:28:34
Message-ID: CAA4eK1J-W2omce_+D+Nn9syUA3DPOkKHyB1K24pXGCEpfksYkg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 10, 2026 at 5:11 PM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> Dear Vignesh,
>
> > Thanks kuroda-san. I have addressed this in the v2 version patch
> > attached, however I did not change the lock mode and used the existing
> > AccessShareLock mode itself as I felt that should suffice. This
> > approach also addresses Chao's comments from [1].
>
> My intention was similar but can we unify codes for re-validation?
> My idea attached here could be applied atop v2.
>

Fair enough. But why do we want to change the order of heap_freetuple
in the following change?

- heap_freetuple(tup);
+ LockDatabaseObject(PublicationRelationId, pubid, 0,
+ stmt->options ? AccessShareLock : AccessExclusiveLock);

- /*
- * It is possible that by the time we acquire the lock on publication,
- * concurrent DDL has removed it. We can test this by checking the
- * existence of publication. We get the tuple again to avoid the risk
- * of any publication option getting changed.
- */
- tup = SearchSysCacheCopy1(PUBLICATIONOID,
- ObjectIdGetDatum(pubid));
- if (!HeapTupleIsValid(tup))
- ereport(ERROR,
- errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("publication \"%s\" does not exist",
- stmt->pubname));
+ heap_freetuple(tup);

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Yogesh Sharma 2026-09-10 13:39:58 Re: docs: Fixes for August 2026 minor release notes (v14-v17)
Previous Message Andrey Borodin 2026-09-10 13:23:20 Re: Avoid streaming zero-filled WAL switch padding