I've attached rebased versions of the remaining two patches.
On Tue, Jun 20, 2023 at 11:43:05AM -0700, Jeff Davis wrote:
> * REINDEX TABLE applies to all indexes in all partitions, which seems
> a bit inconsistent.
>
> The only behavior I'm worried about is REINDEX. I'm not sure what we
> should do about it, or if we even want to do something about it. If we
> want REINDEX to fail in this case, we should be sure to check
> permissions on everything up-front to avoid doing a lot of work. The
> only other option I can think of is to REINDEX only those indexes
> declared on the partitioned table (not the individual partitions),
> which seems consistent but might be confusing to users.
At the moment, I think I'm inclined to call this "existing behavior" since
we didn't check privileges for each partition in this case even before
MAINTAIN was introduced. IIUC we still process the individual partitions
in v15 regardless of whether the calling user owns the partition.
However, I do agree that it feels inconsistent. Besides the options you
proposed, we might also consider making REINDEX work a bit more like VACUUM
and ANALYZE and emit a WARNING for any relations that the user is not
permitted to process. But this probably deserves its own thread, and it
might even need to wait until v17.
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com