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.94.2) (envelope-from ) id 1srtA4-005Brb-Cv for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Sep 2024 06:00:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1srtA2-00EJ9l-5A for pgsql-bugs@arkaria.postgresql.org; Sat, 21 Sep 2024 06:00:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srtA1-00EJ9X-T4 for pgsql-bugs@lists.postgresql.org; Sat, 21 Sep 2024 06:00:03 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srtA0-000I4V-ML for pgsql-bugs@lists.postgresql.org; Sat, 21 Sep 2024 06:00:02 +0000 Received: from [172.20.10.7] (unknown [49.97.72.107]) by oss.nttdata.com (Postfix) with ESMTPSA id 65A1761ACD; Sat, 21 Sep 2024 14:59:57 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com Message-ID: <5f37ee56-14fb-44fe-9150-9eb97e10538b@oss.nttdata.com> Date: Sat, 21 Sep 2024 14:59:51 +0900 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: vacuumdb: permission denied for schema "pg_temp_7" Content-Language: en-US To: Tom Lane , Noah Misch Cc: Nathan Bossart , vaibhave postgres , pgsql-bugs@lists.postgresql.org, vsekar@microsoft.com References: <20240920190731.37.nmisch@google.com> <20240920215030.8d.nmisch@google.com> <2603142.1726873660@sss.pgh.pa.us> From: Fujii Masao In-Reply-To: <2603142.1726873660@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024/09/21 8:07, Tom Lane wrote: > Noah Misch writes: >>>>> That helps, but we'd probably want to do something more general about vacuumdb >>>>> and schema USAGE permission. > > I agree a more general fix is needed, but I think excluding temp > tables as suggested is a good idea for performance, independently of > permissions concerns. vacuum_rel() will ignore requests to vacuum > such tables, which is why we've not heard complaints before, but > nonetheless we're wasting server round trips by issuing those > requests. +1 It looks like reindexdb has the same issue. It would be good to update reindexdb to skip temp tables as well to fix this. + appendPQExpBufferStr(&catalog_query, " AND c.relpersistence <> 't'"); For the proposed patch, it seems better to use CppAsString2(RELPERSISTENCE_TEMP) instead of 't'. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION