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 1qBTtK-0003wu-KL for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jun 2023 05:26:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qBTtJ-0002pS-8r for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Jun 2023 05:26:57 +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 1qBTtH-0002pJ-Vk for pgsql-hackers@lists.postgresql.org; Tue, 20 Jun 2023 05:26:56 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qBTtD-003BJH-Sg for pgsql-hackers@postgresql.org; Tue, 20 Jun 2023 05:26:54 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 6E1D33200916; Tue, 20 Jun 2023 01:26:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 20 Jun 2023 01:26:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1687238809; x=1687325209; bh=ix tlDJiCnO+3dEvBlnQGZ5rPdGAIVBmGD/8nG9ayuN0=; b=JEfgrrMoY3dwyVGYJQ JIpJZfVgC/kb/3O38MBlARLyLwHan7qh6IME3Y8hT4sURzlALlxEi1wnXmR+DZxI +fIiSo4fk76G9oG8F20A6Okh33bPHmkudAQJCDrIgI340bIGimk2VG60wg/85plk 7WK/A1KqerP4OLAl+pvmcjBrnb778ocO9PmbosNp7uz48hg7DzoT9Fh37i2yY6Ws iJ/LkP12VIe8ccf3uT9ELMx4EX/EprfChLdUWbrTh69wtLO0dOao5SysXxYacrBq 1pWZCvJAjw9Xg4hsLxdGvjN1iHXEEb8RsScAkk0lIDQt1FT4wjTYlzLVCdsP+ooe A3pw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1687238809; x=1687325209; bh=ixtlDJiCnO+3d EvBlnQGZ5rPdGAIVBmGD/8nG9ayuN0=; b=fTYaieahyQwNOGpLq53BcOZhN6GTr afZx56BXy3XnszLjNt0EgzzNvJT0b4hLS4UFiLA7WIHpE13rzlxjyxokXeusq5ml PgTs8uCn3b9KOw388ZT1vEGAYyI/sQ4w86Ob/u6DaT4UP55j/UiMoLdP0NhjCcWv FVkhEJz+dI4qKk8eBBPgaZ0oGLWCX7uSrLm5ePLlK4Hm1JO/WRWp6t8XTd9GjHEz NIS0ca8cYwQXjjrAbY3fnzyGVBBanwE7wo5H4W29x3mp7pRbD/gCQ9ECosglzVQj ApWLhHSRu+FWKSN4V9kDNDsKyso3JQxcAHlrd0JVV+6JHUAv/bxv9+9QQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeefgedghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 20 Jun 2023 01:26:46 -0400 (EDT) Date: Tue, 20 Jun 2023 14:26:42 +0900 From: Michael Paquier To: Nathan Bossart Cc: Jeff Davis , Ted Yu , Pavel Luzanov , Justin Pryzby , pgsql-hackers@postgresql.org Subject: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX Message-ID: References: <20230113231339.GA2422750@nathanxps13> <20230613211246.GA219055@nathanxps13> <20230613235442.GA222795@nathanxps13> <20230614181711.GA488295@nathanxps13> <20230615041044.GA736001@nathanxps13> <20230615235700.GA877311@nathanxps13> <20230616052025.GA1026700@nathanxps13> <20230619215534.GA442477@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6l+fx4qU4wKUB4wX" Content-Disposition: inline In-Reply-To: <20230619215534.GA442477@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6l+fx4qU4wKUB4wX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 19, 2023 at 02:55:34PM -0700, Nathan Bossart wrote: > In v4 of the patch set, I moved the skip_privs flag refactoring to 0001. = I > intend to commit this tomorrow unless there is additional feedback. Fine by me. 0001 looks OK seen from here. > These object_ownercheck() calls were removed because they were redundant, > as owners have all privileges by default. Privileges can be revoked from > the owner, so an extra ownership check would effectively bypass the > relation's ACL in that case. I looked around and didn't see any other > examples of a combined ownership and ACL check like we were doing for > MAINTAIN. The only thing that gives me pause is that the docs call out > ownership as sufficient for some maintenance commands. With these patche= s, > that's only true as long as no one revokes privileges from the owner. IMO > we should update the docs and leave out the ownership checks since MAINTA= IN > is now a grantable privilege like any other. WDYT? TBH, I have a mixed feeling about this line of reasoning because MAINTAIN is much broader and less specific than TRUNCATE, for instance, being spawned across so much more operations. As you say, owners of a relation have the MAINTAIN right by default, but they would not be able to run any maintenance operations if somebody has revoked their MAINTAIN right to do so, even if they are the owners of the so-said relation. Perhaps that's OK in the long run, still I have mixed feeling about whether that's the best decision we can take here,=20 especially because MAINTAIN impacts VACUUM, ANALYZE, CLUSTER, REFRESH MATVIEW, REINDEX and LOCK. Some users may find that surprising as they used to have more control over these operations as owners of the relations worked on. -- Michael --6l+fx4qU4wKUB4wX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmSROJIACgkQnvQgOdby QH3sUBAApigFM7iFxKMgWR+0RYxUaaJkzB+5a3qtEWnDIGhYgGgS0I8dR9VwkUNP ehJIesOiUYwegHOVTPW7xHSMwVY6iB09/9MBGEsCM7Hg8N+tYdTOJ0jpR4ZyoaFU i77QEQU/erJ5yc016RS1KBDWf2hsXz94mhWFwtv2Rvp3Tbt+RU0VJkd8L8IgAOWq Wxbw+CU2tMbidrT4rvKuJEDdPw8zG1O4S1hXwPVvc4iCbGs8A9iyyMsz2BEafhse EKDUBBrLjT1gTxqOS/CmnX1hCLbMasO2zogsfCgmy2cgUaxeMboUdgwlb7Sq1/K0 UQkmkJBncMt7ejqnQdTJEyVr2SdoV/V3rQJ1SG6/XSxHiaAKz8odclVELFi4Q2jh O3jtOLYDwdAVhC7uawTdwfkR5yzUGjmHW5vV80dRqIy7EAMvcP8s0WRhaK85IhqL HPgAJl+1mW6VITXdkEBwGyhnYtFJ+Dkkl9mQIIFcJNQ2CyKF04Kj60W3D25uDokb Ot31DknkFx6Agr1fxZ5F0jecD20DvASeeXacreEdwKPttBUh0g55WoLt/H+Z4hdo AJB86VmAc17WljKDfKvwKgmBGc4Ngwrtpk7tPaeWOFaeT3WKjKUeETnmM1WY99O2 Xkn0sUp/0HtOAtEa2gUA4OLnfoFQFLPNPwDkEVNb5EWF2hZftYE= =j+JR -----END PGP SIGNATURE----- --6l+fx4qU4wKUB4wX--