pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Cc: Ted Yu <yuzhihong@gmail.com>
Cc: Pavel Luzanov <p.luzanov@postgrespro.ru>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX
Date: Wed, 21 Jun 2023 07:53:52 +0900
Message-ID: <ZJIuACTWxMFikGP8@paquier.xyz> (raw)
In-Reply-To: <edf8dc01333f4b3355aa91001cb26029cab1eb2e.camel@j-davis.com>
References: <20230613211246.GA219055@nathanxps13>
	<ZIj4v1CwqlDVJZfB@paquier.xyz>
	<20230613235442.GA222795@nathanxps13>
	<20230614181711.GA488295@nathanxps13>
	<ZIpfack6qJUHaw+g@paquier.xyz>
	<20230615041044.GA736001@nathanxps13>
	<20230615235700.GA877311@nathanxps13>
	<20230616052025.GA1026700@nathanxps13>
	<20230619215534.GA442477@nathanxps13>
	<edf8dc01333f4b3355aa91001cb26029cab1eb2e.camel@j-davis.com>

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

Attachments:

  [application/pgp-signature] signature.asc (832B, ../ZJIuACTWxMFikGP8@paquier.xyz/2-signature.asc)
  download

view thread (79+ messages)  latest in thread

Message-ID: <ZJIuACTWxMFikGP8@paquier.xyz>
Permalink:  ../ZJIuACTWxMFikGP8@paquier.xyz/
Also on:    postgresql.org/message-id/ZJIuACTWxMFikGP8@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: michael@paquier.xyz, pgsql@j-davis.com, nathandbossart@gmail.com, yuzhihong@gmail.com, p.luzanov@postgrespro.ru, pryzby@telsasoft.com
  Subject: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX
  In-Reply-To: <ZJIuACTWxMFikGP8@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox