On Fri, Nov 27, 2026 at 9:48 AM vignesh C <[email protected]> wrote:
>
>
> 0002: Preserve conflict log tables and conflict_log_destination during upgrade
>

Few comments:
=============
*
---
Outside binary-upgrade mode, conflict log tables are recreated when
the subscription is restored, and nothing about them is dumped, unless
they are named explicitly.
---

Why are they dumped even when named explicitly? Do we dump any other
such internally generated table when named explicitly? We probably
need to disallow specifying it explicitly.

*
---
A conflict log table is dumped only along with its subscription.  So it
is not dumped with --no-subscriptions, with -n, -t or -e, by a
non-superuser, or when the post-data section is not dumped, unless the
table is named explicitly with -t or -n.
---

I feel the second sentence (So it ..) seems unnecessary.

*
+ /*
+ * The table was restored by the user running the restore, but it
+ * must belong to the owner of the subscription.  Usually the
+ * subscription is created by the same user, and the owner of both
+ * is then set later by ALTER SUBSCRIPTION ... OWNER TO.  But when
+ * the dump uses SET SESSION AUTHORIZATION to set owners, the
+ * subscription is created by its owner and no ALTER SUBSCRIPTION
+ * follows, so set the owner of the table here.
+ */
+ reltup = SearchSysCache1(RELOID, ObjectIdGetDatum(logrelid));
+ if (!HeapTupleIsValid(reltup))
+ elog(ERROR, “cache lookup failed for relation %u”, logrelid);
+ relowner = ((Form_pg_class) GETSTRUCT(reltup))->relowner;
+ ReleaseSysCache(reltup);

Shouldn’t this be handled via pg-dump? IIUC, it is done to handle a
case when a user manually runs pg_dump --binary-upgrade
--use-set-session-authorization. We already document that
“-binary-upgrade” is for use by in-place upgrade utilities. Its use
for other purposes is not recommended or supported. So, I feel the
above handling is not required.

-- 
With Regards,
Amit Kapila.


Reply via email to