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 1p5Zye-0007vh-4M for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Dec 2022 22:11:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5Zyd-00032T-0M for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Dec 2022 22:11:47 +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 1p5Zyc-00032G-Iw for pgsql-hackers@lists.postgresql.org; Wed, 14 Dec 2022 22:11:46 +0000 Received: from mail-il1-x12f.google.com ([2607:f8b0:4864:20::12f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p5ZyZ-00019b-Jx for pgsql-hackers@postgresql.org; Wed, 14 Dec 2022 22:11:45 +0000 Received: by mail-il1-x12f.google.com with SMTP id j28so7291229ila.9 for ; Wed, 14 Dec 2022 14:11:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xg4mhabLIgZbrBQFSZa+S/Dg8H+gR1DGyqrlB9H/yfU=; b=Oua9XB1pXO+v2PyVsA6Qk0p8z8lAF2EkvVWR/azypXUGu4Atn+anjbtAKIhUR/NHSD LoQfR1AA0t5RDAkMGYBJD4TQi2haPhTicmL4JhraLQZqq7VGmDlCSpX3UmFLTmwZV4rc CqbfwPlA7U0wx3toNmwzkxYmM7hxW8QjnbHgczMU+II8sNH9MTydOck5txbdCUuMAS+d nZt7Qyw+EdR7AqbPcWkRzM83+ngJTw9cqoNsC2xeUc6VyMzy5J1SqJvH+yrslMIZBEDO O3zV0l1s9+3pdIyDf81jn2EP2rVvSOkGvEknF4h+abOkfISPitv3xpM0+TxuRiO+iDu9 PrpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xg4mhabLIgZbrBQFSZa+S/Dg8H+gR1DGyqrlB9H/yfU=; b=i33ZGKgC+df4+AyWujocPjDZkqsdlni3oj1ujUoLvOFd/aiTOK/KMKvRJ10RI3YJ6h LIc2sxzobqniCpNQpLh53eSK/CiQfCmgUGF2VXHGQv0u6NGR73GQuy1EQs7bhcpNBCm2 fRFyNcuuqjlGLebamjiXq4zBl+nQD7pgihqCGEXlTtJRAGF78XV1vOhR0jKmZg5FhvNX QmDyYcAlG2OpfBRMVzLU1QquL6Gunn9KcmvIuU0EnbDGhY1aR0FbtuO/v1C1IeseYhwC KnWnLDHIbI+hLo8QE5q44qtSBorC0IatFQTSUzlu4R/EFj7jumnfprf10Qo4dPkcvUxS 2XPw== X-Gm-Message-State: ANoB5pneL8mXVGZ9dX+XIFGt6oXqk7xgY96CpasVKCzTChXZ46LrOazB D5/AECiQwshRLb8ViNCeNehR+F/V+NjVdxzA X-Google-Smtp-Source: AA0mqf5gr8IUtDp0Umcu2WDRxXPkT/ncZM1FHv8JaT9hBEpVmJg5Kqltm05Qmeq1d+wLgvDO1oOBdw== X-Received: by 2002:a92:c848:0:b0:303:564e:8603 with SMTP id b8-20020a92c848000000b00303564e8603mr13473621ilq.18.1671055901980; Wed, 14 Dec 2022 14:11:41 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id z33-20020a0293a4000000b0036cc14af7adsm2149490jah.149.2022.12.14.14.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 14:11:41 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 85E6A800F3C; Wed, 14 Dec 2022 16:11:40 -0600 (CST) Date: Wed, 14 Dec 2022 16:11:40 -0600 From: Justin Pryzby To: Pavel Luzanov Cc: Jeff Davis , Nathan Bossart , pgsql-hackers@postgresql.org Subject: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX Message-ID: <20221214221140.GA1153@telsasoft.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8f7172da-2b58-3bd0-97ae-5126e2a7970c@postgrespro.ru> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Dec 15, 2022 at 01:02:39AM +0300, Pavel Luzanov wrote: > On 14.12.2022 22:46, Jeff Davis wrote: > > The behavior is that MAINTAIN > > privileges on the partitioned table does not imply MAINTAIN privileges > > on the partitions. I believe that's fine and it's consistent with other > > privileges on partitioned tables, such as SELECT and INSERT. > > Sorry, I may have missed something, but here's what I see: > > postgres@postgres(16.0)=# create table p (id int) partition by list (id); > postgres@postgres(16.0)=# create table p1 partition of p for values in (1); > postgres@postgres(16.0)=# create table p2 partition of p for values in (2); > > postgres@postgres(16.0)=# grant select, insert, maintain on p to alice ; > > postgres@postgres(16.0)=# \c - alice > You are now connected to database "postgres" as user "alice". > > alice@postgres(16.0)=> insert into p values (1); > INSERT 0 1 > alice@postgres(16.0)=> select * from p; >  id > ---- >   1 > (1 row) > > alice@postgres(16.0)=> vacuum p; > WARNING:  permission denied to vacuum "p1", skipping it > WARNING:  permission denied to vacuum "p2", skipping it > VACUUM Yeah, but: regression=> insert into p1 values (1); ERROR: permission denied for table p1 regression=> select * from p1; ERROR: permission denied for table p1