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 1p5uDM-0000KY-Vu for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Dec 2022 19:48:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5uDK-0002op-Uu for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Dec 2022 19:48:18 +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 1p5uDK-0002oH-Bz for pgsql-hackers@lists.postgresql.org; Thu, 15 Dec 2022 19:48:18 +0000 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p5uDH-00047Q-C4 for pgsql-hackers@postgresql.org; Thu, 15 Dec 2022 19:48:17 +0000 Received: by mail-il1-x12e.google.com with SMTP id d10so167142ilc.12 for ; Thu, 15 Dec 2022 11:48:15 -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-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=r9tpMditwHmgGLxQsq3nMYUAkzZUmT3Cnp8wBXooKx4=; b=Tm5mtn4ja8o87Z0zZQOtdgRqFnvnINeOCAKyhiAJMAMMXWSmh2KK70I2YdxWEvET3O XEnzAzxMb9rNmUl2+n3f/ediYhG9JS44coMBiusBVVa2KRS7PRRPUTQpWjCLI+AFzXEA /bkrpd/lsI2Pcm5WVJ6tl4/zjrN2sVKLsEk9uoBovdL3vQpqctwvs2cXBLWFNfQ6awqq hEBlGZ5Q1zOKHqq1f4LPamVIuQoBTA4KaA3U0atpDphkdLz+1L4MF0KE16Fc5zNugcJt zWnwsVoVBDdMCPWsPkuMlj2DVuQ/m71RkvVkeHENMzzzzpAJYkkqwF8UTW2tSyRe5jLu lZAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to: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=r9tpMditwHmgGLxQsq3nMYUAkzZUmT3Cnp8wBXooKx4=; b=QwL7qm96kng2Soi2w0M60XdJtWOj9zvr1G8X6DCIGuF4jFV3hHsB5y9h9+xDfE3qIm CRQ6LpCiel2TM+qNLPIbyknfjztO1FLPT8bBvVMcNEumHu3N9ppCn0BGPk5ct+voBfn1 EGg7hIIwZ3bPCZfcNe3daG93M7vKbg2p65r4yljwBtzqfLkstfxMzeE8+iipmeTkuKF8 I4sqFAWhCd0DtvY+B/J5BxhAcqGnUKLUt5ejOppEfGp6bVNO43yRFIvu0lWCM/Sx01OH 1nwd383d6AZVmziPb8MJv4Yupxf1tfyeXLhHU4q0scylKl0pn2cOzTN9MTNK9uY94CEb JA7Q== X-Gm-Message-State: ANoB5pklItHUN4kK7IL64GR0tmf1aSjugktyESFVbBfw4Wm7bvAfP9e6 NMeNINzmyX3NCuUTUHL4lTqzsA== X-Google-Smtp-Source: AA0mqf6D8Muz8WZ2tJnb7mRmMIBNtJUWGvY0VboRauV+rJ5A1FPEtQwi0i06a/VSO5Lh1xLp+xnR6w== X-Received: by 2002:a92:c5cf:0:b0:304:bf1f:d72f with SMTP id s15-20020a92c5cf000000b00304bf1fd72fmr8786618ilt.32.1671133694735; Thu, 15 Dec 2022 11:48:14 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id y20-20020a056638229400b00389e9e6112csm73336jas.70.2022.12.15.11.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 11:48:14 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 3701F800665; Thu, 15 Dec 2022 13:48:13 -0600 (CST) Date: Thu, 15 Dec 2022 13:48:13 -0600 From: Justin Pryzby To: Jeff Davis Cc: Pavel Luzanov , Nathan Bossart , pgsql-hackers@postgresql.org Subject: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX Message-ID: <20221215194813.GK1153@telsasoft.com> References: <20221212210136.GA449764@nathanxps13> <20221214032332.GA671806@nathanxps13> <8f7172da-2b58-3bd0-97ae-5126e2a7970c@postgrespro.ru> <20221214221140.GA1153@telsasoft.com> <295e86c7aeafb8e2623f8eccdc846855bf2c7e0c.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <295e86c7aeafb8e2623f8eccdc846855bf2c7e0c.camel@j-davis.com> 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 10:10:43AM -0800, Jeff Davis wrote: > On Thu, 2022-12-15 at 12:31 +0300, Pavel Luzanov wrote: > > 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. > > There is some weirdness in 15, too: I gather you mean postgresql v15.1 and master ? > -- the following commands seem inconsistent to me: > vacuum p; -- skips p1 with warning > analyze p; -- skips p1 with warning > cluster p using p_idx; -- silently skips p1 > reindex table p; -- reindexes p0 and p1 (owned by su) Clustering on a partitioned table is new in v15, and this behavior is from 3f19e176ae0 and cfdd03f45e6, which added get_tables_to_cluster_partitioned(), borrowing from expand_vacuum_rel() and get_tables_to_cluster(). vacuum initially calls vacuum_is_permitted_for_relation() only for the partitioned table, and *later* locks the partition and then checks its permissions, which is when the message is output. Since v15, cluster calls get_tables_to_cluster_partitioned(), which silently discards partitions failing ACL. We could change it to emit a message, which would seem to behave like vacuum, except that the check is happening earlier, and (unlike vacuum) partitions skipped later during CLUOPT_RECHECK wouldn't have any message output. Or we could change cluster_rel() to output a message when skipping. But these patches hardly touched that function at all. I suppose we could change to emit a message during RECHECK (maybe only in master branch). If need be, that could be controlled by a new CLUOPT_*. -- Justin