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 1p5kb4-0004eO-W8 for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Dec 2022 09:32:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5ka5-0006He-OA for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Dec 2022 09:31:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5ka5-0006HV-9d for pgsql-hackers@lists.postgresql.org; Thu, 15 Dec 2022 09:31:09 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5kZy-0003dR-HU for pgsql-hackers@postgresql.org; Thu, 15 Dec 2022 09:31:08 +0000 Received: from [192.168.28.30] (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 9187F21C1D3E; Thu, 15 Dec 2022 12:31:00 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1671096660; bh=nZp5qQwnqT5KOvalc+4w8D4FU8/Y7vLfXH1cZS/kKmM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=aA24vm7JL9qM33Nya5IlxQNh97inNjCMqwK9NmlDIDRPDi2V5tv3W8269T96qi9X9 OO+cLIJGdDfZHttBfWJ1ABXJkA7g8Mkc5y3kZspX+TbUUUfXVZ+pcb7hUa56rOSXGT AnLp0rcfgom6i4GLgUTsPS+7QRgET3CRYh0Z5rQM= Message-ID: Date: Thu, 15 Dec 2022 12:31:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX Content-Language: en-US To: Jeff Davis , Justin Pryzby Cc: Nathan Bossart , pgsql-hackers@postgresql.org References: <20221208183707.GA55474@nathanxps13> <210dc2cc663934f8b463e4effa9af86225e46ce4.camel@j-davis.com> <20221210204109.GA197392@nathanxps13> <20221212200427.GA448418@nathanxps13> <20221212210136.GA449764@nathanxps13> <20221214032332.GA671806@nathanxps13> <8f7172da-2b58-3bd0-97ae-5126e2a7970c@postgrespro.ru> <20221214221140.GA1153@telsasoft.com> From: Pavel Luzanov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 15.12.2022 03:18, Jeff Davis wrote: > Right, that's what I had in mind: a user is only granted operations on > the partitioned table, not the partitions. It's all clear now. > There's definitely a problem with this patch and partitioning, because > REINDEX affects the partitions, CLUSTER is a no-op, and VACUUM/ANALYZE > skip them. I think the approach that Nathan implemented [1] for TOAST tables in the latest version can be used for partitioned tables as well. Skipping the privilege check for partitions while working with a partitioned table. In that case we would get exactly the same behavior as for INSERT, SELECT, etc privileges - the MAINTAIN privilege would work for the whole partitioned table, but not for individual partitions. [1] https://www.postgresql.org/message-id/20221215002705.GA889413%40nathanxps13 -- Pavel Luzanov Postgres Professional: https://postgrespro.com