hi.
now stats_lock_check_privileges comments need to change?
* Lock relation in ShareUpdateExclusive mode, check privileges, and close the
* relation (but retain the lock).
since the above comments will not be true for RELKIND_INDEX.
Yes, there are comments within the function explaining the exception.
maybe we can incorporate the following
/*
* For indexes, we follow what do_analyze_rel() does so as to avoid any
* deadlocks with analyze/vacuum, which is to take out a
* ShareUpdateExclusive on table/matview first and only after that take
* a AccessShareLock on the index itself.
*/
comments into stats_lock_check_privileges comments section.
other than that, the patch fix looks good to me.