Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wMRYK-0005mJ-0q for pgsql-bugs@arkaria.postgresql.org; Mon, 11 May 2026 14:24:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wMRYG-000tDy-29 for pgsql-bugs@arkaria.postgresql.org; Mon, 11 May 2026 14:24:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wMRYG-000tDq-1A for pgsql-bugs@lists.postgresql.org; Mon, 11 May 2026 14:24:08 +0000 Received: from mail-oa1-x31.google.com ([2001:4860:4864:20::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wMRYE-000000003a6-0VRb for pgsql-bugs@lists.postgresql.org; Mon, 11 May 2026 14:24:08 +0000 Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-40ef10ec84cso3562563fac.2 for ; Mon, 11 May 2026 07:24:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778509444; x=1779114244; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=AZmx3z3IM20lRfTjApGYp1BURVmJLKKDI9PeG/+g3sA=; b=YET+uvHcWxCDsybB0YrjMAs6FMJ2G1UboIMfPpQUxvRPhhNXyd4JCfhsru58+iuzha XAzsrqTI2zYxaCdmixLEGXR0wqUBi6Eb6B/juHEwJWdgxS+yIPzLuKEd5P0yMtnanIEb QJbbQEcusKMzXPY4uFXeQqM47iTx0YJ7A/AKkkvlYC/JVLb4ai/KXtytDJL/8yAHC85R HTxm2KIxwNA1yVOT5VSxc7yvouXeaAoqIF1sK2+UM/LU9lpzmu9hJZu+nBOUyYH3jF9I WryVYvYbdhgDuxQjefx8VLpI7pdSdAo+UJIrVkrsOqFD1OONBEXaqRFbKc1Nr47NZ/ER 2pJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778509444; x=1779114244; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AZmx3z3IM20lRfTjApGYp1BURVmJLKKDI9PeG/+g3sA=; b=CI06OaP7SHaXBZxg3wZCGvEoyyn5xeB3C3edYhpzoF9Q8luXnAE01YiU1NenuDTZoT UJzVQsPWuHmqTfx9b0D9BSeYcEXjsZczp5zhQCX9JxXmRRMxbvBLd4zrTg8zRIArt/t9 8wY60SlsfEeEShQ7fvRDA/SvhdB1nKAO2nUC9ttcUYmEucSMjl5/TG4rbmTpahp2eVa/ EZOtLkjtUZyOy+W+HbZ3Lsynks+u22gMLTeP2vZDxS9B2zr1YPu3rXdgETusuMtY5dBF s18dDxYr5nAFc5gLwZ2l9Fi3hWI6NryK9TcxJ6qZgorKRMe/Pz90LF/n/6DyGnCbvnJ5 Eesw== X-Forwarded-Encrypted: i=1; AFNElJ/k9egquX38xnQX4/Cclb/OOzKhf/zpMF6uj8Q1gaAmtSaWiWI9H7cx061hnBEO1ffonqJ60IUQxYFD@lists.postgresql.org X-Gm-Message-State: AOJu0YzTdVGHA1o5aL8+UJq3Kzmw2HcQPp2OjFWrv9OJ8akUpvfipf9E rmromUWPSe4SxHBIgnB70FJGVLllUFdzP1Kld/yu02TowUZ36KBpLAdc X-Gm-Gg: Acq92OHWfRLlmKH/3a0/9gzSBXG8qOduSHMuTTvvI7IkkGAmhLmBQsBpOuVz6d9FqYk 58Ag2JanoYRUbQf2hwhE+huNOrzO1kDkzz2cDH2HerXuKuVo100S12dVYwvpVUolVQ9+SdnuJ6d yttnBTyGs+UlGQ9gkdUTOlQsbR/zQmY7L8nGyuon4Z2BZPHG/rTH0rwtzxhydCcTmEPEE+rllPe TD6bFMN2KjK3a+H83tpvHtgbgmGPcYkAvjF7UKT40EYEKKPKswCOiwfCEaDJV2rSDDWGHxSsU6c ZWiS+yMXnTQD/jnaVTpPXj1KMN28SQdgfada+6auvuXo03vRXKUWcrYA4Axwf7+3p4nbg//uw2v VXCNStvMqnreRN9wAuegd93bmKWEz2PjLk3xi0dskRPc3JQfmnPIpM/i1+6ZB7it8TfrIR1MxOW jYMyTmfvcNq83J2n25w1+7VDgDCr887vP/4isAOusRLQVIB3hiei6VYK8J6iJ13FfHr+kK3e06F XTowqvJK9xsv0XnK31+aw== X-Received: by 2002:a05:6820:160b:b0:694:9a8a:2ce with SMTP id 006d021491bc7-69998c8fed0mr12673475eaf.8.1778509444477; Mon, 11 May 2026 07:24:04 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435570ad8f4sm9857038fac.4.2026.05.11.07.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 07:24:03 -0700 (PDT) Date: Mon, 11 May 2026 09:24:02 -0500 From: Nathan Bossart To: 798604270@qq.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19475: VACUUM on a partition still warns after MAINTAIN is granted on the partitioned parent Message-ID: References: <19475-513aa13168f22afe@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <19475-513aa13168f22afe@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, May 11, 2026 at 07:41:42AM +0000, PG Bug reporting form wrote: > I tested the current PostgreSQL master at commit 901ed9b352b (postgres > --version reports PostgreSQL 19devel). The current branch already contains > commit ff9618e82a466fc9c635f9f087776e57b21e4f14, whose commit message says: > > “For partitions, allow the maintenance command if the user has the MAINTAIN > privilege on the partition or any parent.” Note that MAINTAIN was reverted after commit ff9618e82a and was reintroduced in commit ecb0fd3372, so the former's commit message may no longer be accurate. > However, the following test case still produces a permission warning when > VACUUM is run directly on a partition after granting MAINTAIN only on its > partitioned parent. > > Reproduction: > > ``` > CREATE TABLE parent (a int) PARTITION BY RANGE (a); > CREATE TABLE child PARTITION OF parent > FOR VALUES FROM (0) TO (100); > INSERT INTO parent VALUES (1), (2), (3); > > GRANT MAINTAIN ON parent TO main_role; > > SET client_min_messages = warning; > SET ROLE main_role; > > VACUUM child; -- WARNING: permission denied to vacuum "child", skipping it The current VACUUM documentation states the following: To vacuum a table, one must ordinarily have the MAINTAIN privilege on the table. However, database owners are allowed to vacuum all tables in their databases, except shared catalogs. VACUUM will skip over any tables that the calling user does not have permission to vacuum. -- nathan