Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Ted Yu <yuzhihong(at)gmail(dot)com>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX
Date: 2023-06-20 22:53:52
Message-ID: ZJIuACTWxMFikGP8@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 20, 2023 at 11:43:05AM -0700, Jeff Davis wrote:
> 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.

Yes, that feels a bit inconsistent to only check the partitioned table
in RangeVarCallbackForReindexIndex() and let all the partitions
process as a user may not have the permissions to work on the
partitions themselves. We'd need something close to
expand_vacuum_rel() for this work. I am not sure that this level of
change is required, TBH, still it could be discussed for v17~.

> 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.

I am not sure to understand this last sentence. REINDEX on a
partitioned table builds a list of the indexes to work on in the first
transaction processing the command in ReindexPartitions(), and there
is no need to process partitioned indexes as these have no storage, so
your suggestion is a no-op?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2023-06-20 23:44:20 Re: Improve logging when using Huge Pages
Previous Message Nathan Bossart 2023-06-20 22:52:57 Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX