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 1pGRdF-0000io-Sj for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 21:30:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pGRdE-0002h1-IW for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 21:30:36 +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 1pGRdE-0002gr-4O for pgsql-hackers@lists.postgresql.org; Fri, 13 Jan 2023 21:30:36 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pGRdB-0005hb-Nq for pgsql-hackers@postgresql.org; Fri, 13 Jan 2023 21:30:35 +0000 Received: by mail-pj1-x1031.google.com with SMTP id z1-20020a17090a66c100b00226f05b9595so10556463pjl.0 for ; Fri, 13 Jan 2023 13:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20210112.gappssmtp.com; s=20210112; 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=F/U7vNU5J5hlh15icKPeLy7+zu7TrI0f4OzD8SSoHbk=; b=6HLoenzXiJEgbfOpo0NePQrvK/8ShLEf3u9xemqYVQR0gLnhRSd07JJwskSKOA2/rj vIMwD2Pko2draefGvUq7JW9bpW5oVvhmYHYrApZMz13HWdaDKX2KDIMqfJol3vY2d/HT c5DRwqDWmJW2cU1OUchq4zgC1AwDC47cv4z3DM4Rr5f9d0S4OQGKuKjBJdG5RaKbMpaX U5lo6+jWb6r4vNOjJ8mU7sbT1s85Qq8I7OcyshExpEQVeIp/8b2WKr/nLoICRXYummp7 zBH1GJrz2uxE9uVhD8wyBHTKizZSbsy+Cv5qkWfWFRNBKTI99djxJCw2+jt+fBBRFiwP gvhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=F/U7vNU5J5hlh15icKPeLy7+zu7TrI0f4OzD8SSoHbk=; b=QeLi0Hop6WAUzoPMDlD000FEcDS3ytLEGvrWO2SU757uW2oQh/CKqIgRTuLhxFWnXa vn7d3Wo1iS4qmyR7C6+FjgpxROMN/Cn/8HouDHF0HLiuUKyuopNkOsYlGT3VzJgI8rQV 83kz816DvP+k77/Z/nuNqQLIY1uApZqw5m0IbMcJGo26EFsDL2ejnEi/r2RqrHi32aVt fUuf9lUcB+JsQjByrw/v1MV6lr1a55qDjF5OU08c8ki16nvM2LifUPcuXHwV7S0yO7rq Yv9MHI+gVZBHkKG900FI3pwBDQrGMCjjSeM9hSmdcuN9uJR2z1sEr/c1bF5WHENdf+vc E6/w== X-Gm-Message-State: AFqh2komkyKXUx4ht8vi8BgjMdej0PhMUt2bDufLE52TZuNbIn/c2h5k Zmffxqq4z2B7oMRiBlsgc7zKIQ== X-Google-Smtp-Source: AMrXdXtNKQguJ3yk6BgVHWWcNfnsE3x47dHNTJaDfdBSyBOQUYmvPHpSZ95IVIS9Ou+PooJo8wz4YQ== X-Received: by 2002:a17:902:b407:b0:192:bdf8:1a58 with SMTP id x7-20020a170902b40700b00192bdf81a58mr41060883plr.50.1673645431357; Fri, 13 Jan 2023 13:30:31 -0800 (PST) Received: from jeff-laptop.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id e3-20020a17090301c300b00172cb8b97a8sm813265plh.5.2023.01.13.13.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 13:30:30 -0800 (PST) Message-ID: Subject: Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX From: Jeff Davis To: Nathan Bossart Cc: Ted Yu , Pavel Luzanov , Justin Pryzby , pgsql-hackers@postgresql.org Date: Fri, 13 Jan 2023 13:30:28 -0800 In-Reply-To: <20230113203334.GA2206335@nathanxps13> References: <20221214221140.GA1153@telsasoft.com> <295e86c7aeafb8e2623f8eccdc846855bf2c7e0c.camel@j-davis.com> <20221217060408.GA1256247@nathanxps13> <20221218233018.GA1476904@nathanxps13> <20230103234549.GA289060@nathanxps13> <20230109225157.GA1288965@nathanxps13> <7d2a8b72e23c8236281c6e00ae790327f965a8e5.camel@j-davis.com> <20230113203334.GA2206335@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 Fri, 2023-01-13 at 12:33 -0800, Nathan Bossart wrote: > That would fix the problem in the original complaint, but it wouldn't > allow > for vacuuming toast tables directly if you only have MAINTAIN > privileges on > the main relation.=C2=A0 If you can vacuum the toast table indirectly via > the > main relation, shouldn't it be possible to vacuum it directly? Perhaps, but that's barely supported today: you have to awkwardly find the internal toast table name yourself, and you need the admin to grant you USAGE on the pg_toast schema. I don't think we're obligated to also support this hackery for non-owners with a new MAINTAIN privilege. If we care about that use case, let's do it right and have forms of VACUUM/CLUSTER/REINDEX that check permissions on the main table, skip the work on the main table, and descend directly to the toast tables. That doesn't seem hard, but it's a separate patch. Right now, we should simply fix the problem. --=20 Jeff Davis PostgreSQL Contributor Team - AWS