Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBgJt-0006R1-6b for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jun 2023 18:43:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qBgJs-0007hu-31 for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jun 2023 18:43:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qBgJr-0007hk-MN for pgsql-hackers@lists.postgresql.org; Tue, 20 Jun 2023 18:43:11 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qBgJp-003I7I-2T for pgsql-hackers@postgresql.org; Tue, 20 Jun 2023 18:43:10 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1b5452b77b4so30869295ad.3 for ; Tue, 20 Jun 2023 11:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1687286588; x=1689878588; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=Gq9U4dxcifaUgMEsexALwKs34p7xWl3OV1ZGICxX8NU=; b=bIdISj8/y9BbZ3/eImPxJjAMPjh83fbVV5GWUwA9NNnwcOvp4D/dOY7s0VdV30qvfI MUCvMeBw7jKxIFLBZokBxy/RSscY7koTT1hMQ6IINEq06H7JbdtMF5AsKgVRaKFOtCu0 VNDyI2AYuTVLxr7eYNjZGu2c7GV6BEE2G41P2TTLk8o5herc3wPqI6Jufi+tRgTnMQnA 6dWwu/neP8O4Vr2LNpD7ShhI1TKTqLT0U7AuQG5kPsTdpbzMIrPJ91f/ovCcrPzCBK82 hs5T0Y+yXA88O+9ehNS87RkGpagyjJb9IOH9YfGGSzAWdhcVc/jIhq3z66NYuEIrrvQr 9/RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687286588; x=1689878588; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Gq9U4dxcifaUgMEsexALwKs34p7xWl3OV1ZGICxX8NU=; b=Y3G35dcIo8VSEJEhrgmTCbgsSB5aH7HPeK99IN/RByd68M4ICIyKAtvh0OTxf3uzoQ guowf8vSdvK9AYkg0PIclJMckMrVvrkQ7RVKfh46JGGJW0kMlzHHrX6v1iErRPgGuHBO 7HtHFRA435T5wguj4TBRc/oR93NXFIeOLao4q9alOtn7XPc50WYHBMKwOmSc1PVvcw22 AHukrfhAtRhW1VZr2dtdqlOZuhvTuOsgqJB2XmgcwTI7KqQnVzTVUQRP1c2jKfNoHkdW /zdyLbjpDzDy7fkeAN0bFq6wq4zmpn52UCGUfyDPUOoKX7GfWUK0WkvuRil6buJvm4vm nvQQ== X-Gm-Message-State: AC+VfDx+wjOpT7YgVP/X07UrnTYUKcItVzTDWEGI0O6NnrZzlWUuqIZA kJx2bHtLh9NyWE1XiB/8vNTp9g== X-Google-Smtp-Source: ACHHUZ6l3TNt79sIHxmoI1t+bYmg5Qs4frBl5R5DhlQ+rUXwqt1v9YAPtZxEufogvUtUsEEjoxSH6w== X-Received: by 2002:a17:902:8214:b0:1aa:d971:4623 with SMTP id x20-20020a170902821400b001aad9714623mr12276845pln.38.1687286588040; Tue, 20 Jun 2023 11:43:08 -0700 (PDT) Received: from jeff-laptop.lan (c-73-170-46-202.hsd1.ca.comcast.net. [73.170.46.202]) by smtp.gmail.com with ESMTPSA id u2-20020a17090282c200b001ac95be5081sm1913182plz.307.2023.06.20.11.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 11:43:07 -0700 (PDT) Message-ID: Subject: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX From: Jeff Davis To: Nathan Bossart , Michael Paquier Cc: Ted Yu , Pavel Luzanov , Justin Pryzby , pgsql-hackers@postgresql.org Date: Tue, 20 Jun 2023 11:43:05 -0700 In-Reply-To: <20230619215534.GA442477@nathanxps13> References: <20230113225626.GA2380176@nathanxps13> <20230113231339.GA2422750@nathanxps13> <20230613211246.GA219055@nathanxps13> <20230613235442.GA222795@nathanxps13> <20230614181711.GA488295@nathanxps13> <20230615041044.GA736001@nathanxps13> <20230615235700.GA877311@nathanxps13> <20230616052025.GA1026700@nathanxps13> <20230619215534.GA442477@nathanxps13> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-06-19 at 14:55 -0700, Nathan Bossart wrote: > I'm hoping to commit 0002 and 0003 by the end of the week so > that these fixes are available in 16beta2. A few observations for the case where a user does have the MAINTAIN privilege on a partitioned table but not the partitions: * they can LOCK TABLE on the partitioned table * ANALYZE works on the inheritance tree but not the individual partitions * CLUSTER and VACUUM are useless because they skip all of the partitions. That's consistent with the purpose of this thread -- to avoid the locking problems trying to support those operations on partitioned tables. * 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. Regards, Jeff Davis