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 1sxqQE-00CnAg-3R for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Oct 2024 16:17:22 +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 1sxqPa-00DJzo-6y for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Oct 2024 16:16:42 +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.94.2) (envelope-from ) id 1sxqPZ-00DJzg-UL for pgsql-bugs@lists.postgresql.org; Mon, 07 Oct 2024 16:16:41 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sxqPV-0033FS-GZ for pgsql-bugs@lists.postgresql.org; Mon, 07 Oct 2024 16:16:38 +0000 Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-45aeef3ce92so32785141cf.2 for ; Mon, 07 Oct 2024 09:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728317795; x=1728922595; darn=lists.postgresql.org; h=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=4uvtWoZyjrMHwPcTlVvV2kaNKq7LPCjDYco2qb/MYR8=; b=GolVaZri/iEjAr16uplIHBjTtPY+UDbr2mFfLzKQAu7Ay0LWN8fWpNEICvnBZpHU03 4pEB9UG9jDk/lUey2Hatjm6G3nq6cO+pHPKzFizGMDUCZXxp4jS0+yBP7+04uvSaFFrc ASAW6lUzVvIbT7e7s+B5lW9Qx5zPWaqRLf2GgekW6hy64iOrTqzcOlRgY4uE7newiNHt WMtYJcK7MpYDYcI2O1oMw5l15YOtHQqQjN3bMpu9ssIZLpoRPV7N2qOeKFaxx466VJBB zvNR/0ASSLmKgFMLABWsdtXHz9+PSIG1272zGLdo9K1tqJrPyAc846gwwwPP/q7U2YLM d8Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728317795; x=1728922595; h=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=4uvtWoZyjrMHwPcTlVvV2kaNKq7LPCjDYco2qb/MYR8=; b=ReyMkalxytoOm+9Su4nhyWO/hfNiEAxUS9ULuqgoowRJO0NJZiUpAveZgoqjRy3prS DzfgTAwkkvWbrENLbPCM1FWhQ9w6CbM1Yw667khqevBPznVvA31/l89qjjNYC171o+56 QGntL5k1wyiPlAHfEOeCnOD9DltFfALoUJeXNkbYvh3TgKvFQ/V9HoyCR/AzSSnlkgp/ ouYc01LAEf2nDnXuOAX7CPanRk4WYgeruvNon054g+VeILmorHbSyPajHpTcVsQ5lHS9 zcKnx3PHf+tlFDGKuFJUgQEVByu23LFcNFePoS7IuPWNwIpf0Q6jZj6G6IOS/T4vFSbK g6hQ== X-Forwarded-Encrypted: i=1; AJvYcCVD+5VyA1StlVanZOEYbRTZIeYxw3QW36zFBUci+O3MJOHYLGXYYU5F2kGqLFYQjF/EsZGvVGcHB7OH@lists.postgresql.org X-Gm-Message-State: AOJu0Yzg5gLm0loQQBryrjHWd5ewGksyhGTAjcYTpssAOVw4sIoB3URa rjkeKZMqX1xeN+U6wh37814OlRghPkI9Sk1qaDBupDrAZZKg1lkj X-Google-Smtp-Source: AGHT+IGHzw9UrXDTqmVoMQjMl/BlzesFghtC7fr2tJiCt2qmoZYO0F9yBzDU3VTqIXnbZKIx3P3qJg== X-Received: by 2002:ac8:7e91:0:b0:458:2ce1:2705 with SMTP id d75a77b69052e-45d9ba6b540mr170470601cf.30.1728317795413; Mon, 07 Oct 2024 09:16:35 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45daad2fcbbsm24647461cf.46.2024.10.07.09.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 09:16:34 -0700 (PDT) Date: Mon, 7 Oct 2024 11:16:33 -0500 From: Nathan Bossart To: Michael Paquier Cc: Fujii Masao , Christophe Pettus , vaibhave postgres , Tom Lane , Noah Misch , pgsql-bugs@lists.postgresql.org, vsekar@microsoft.com Subject: Re: vacuumdb: permission denied for schema "pg_temp_7" Message-ID: References: <20240920215030.8d.nmisch@google.com> <2603142.1726873660@sss.pgh.pa.us> <5f37ee56-14fb-44fe-9150-9eb97e10538b@oss.nttdata.com> <2649165.1726898595@sss.pgh.pa.us> <00d98a9f-bec1-4cd0-b59e-1043ae04c8bc@oss.nttdata.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="3Oxtwi2qhLuGW5nt" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --3Oxtwi2qhLuGW5nt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Regarding commit 1ab67c9... On Wed, Sep 25, 2024 at 08:10:16AM +0900, Michael Paquier wrote: > Thanks. As I am kind of behind this one, I'll go fix it first. Let's > sort out the permission bits after that one is sorted out. REL_17_0 > is out, so this can happen across all branches. For consistency with the surrounding code, I think we should schema-qualify the operator and add a newline after "WHERE relpersistence != 't'". If folks agree, I can handle committing the attached patch. -- nathan --3Oxtwi2qhLuGW5nt Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fix_1ab67c9.patch" diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c index 249622068a..d07ab7d67e 100644 --- a/src/bin/scripts/vacuumdb.c +++ b/src/bin/scripts/vacuumdb.c @@ -684,7 +684,8 @@ vacuum_one_database(ConnParams *cparams, * Exclude temporary tables, beginning the WHERE clause. */ appendPQExpBufferStr(&catalog_query, - " WHERE c.relpersistence != " CppAsString2(RELPERSISTENCE_TEMP)); + " WHERE c.relpersistence OPERATOR(pg_catalog.!=) " + CppAsString2(RELPERSISTENCE_TEMP) "\n"); /* * Used to match the tables or schemas listed by the user, for the WHERE --3Oxtwi2qhLuGW5nt--