On Thu, Jun 25, 2026 at 01:53:39PM +0800, cca5507 wrote:
> I think the current one is ok, so I didn't change this.

+ * Note: this function is called without holding a relation lock for 
database-wide
+ * VACUUM or ANALYZE, so the relation can be dropped concurrently. In that
+ * case, issue a WARNING and return false.

FWIW, even after sleeping on it, I don't think that this patch is
going in the right direction.  I am pretty sure that we should just
lift the ACL check in get_all_vacuum_rels() and always require
vacuum_is_permitted_for_relation() to have the relation locked when
called.  This way we would rely on one single code path for the ACL
check, even if it means holding a reference of a relation OID for
something to be processsed later.  So I would revisit the choice made
in a556549d7e6d.  The isolation test vacuum-conflict also seems OK
with this shortcut, after a quick test, which was the kind of patterns
this commit is after.
--
Michael

Attachment: signature.asc
Description: PGP signature

Reply via email to