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 1sxtbS-00D4lv-Q7 for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Oct 2024 19:41:10 +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 1sxtbR-00FH0P-Gh for pgsql-bugs@arkaria.postgresql.org; Mon, 07 Oct 2024 19:41:09 +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 1sxtbQ-00FGzw-WA for pgsql-bugs@lists.postgresql.org; Mon, 07 Oct 2024 19:41:09 +0000 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sxtbM-0034fC-7S for pgsql-bugs@lists.postgresql.org; Mon, 07 Oct 2024 19:41:08 +0000 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3e045525719so3016405b6e.2 for ; Mon, 07 Oct 2024 12:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1728330062; x=1728934862; darn=lists.postgresql.org; 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=XK+tFQF+nsEeawD4E84Nfw0ha6LMl0cEhN6YQKXcFjY=; b=KddQsRq5bLMs2haxTo0HllaU4Kus/QD+RdfBc2E9yAlQ8EygZP4njk/s+qzrokaoio ZgtyWJvnNSRbN2UyOoV9jPsPvlwVT90GrEqOnYwQlIEgy1VVkyFO1v5UwCW+H8gu7YfO j1huno1BuY70RL0XTywfBoJsvMvSmmZNeJCgs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728330062; x=1728934862; 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=XK+tFQF+nsEeawD4E84Nfw0ha6LMl0cEhN6YQKXcFjY=; b=clWp7UZKwR0dAEcw+2o4V8K8WuZ9wPTElnkWkSThBpVuYz+hfSEwnvJaPb/ZSvU1qH S/vBrHeG6Z/zXVzHI9z8DU9hy9GdKWwZ3V6MUZnIw1wGnvNORnUNbeO7raQEd/q8IbVz u/WVL7gPsBnRd8CcQrmO5Dv8VudREaMWaLVwuQVzTu2KUtdKQ2c0I1kcltMcBVVebIVc jJEnPNzfE+f1mXFOJ/aYuLE14ckeypGQINphR4XhO8t0qy/cyMEsJ+os/vWAnJZ5JbK7 klI0sHGQEMmz8A9defHxkefIpippfB/riMrL3sJPQ6Z0mDN43g9+xfz9yI1GAwPxmDuF +zCg== X-Forwarded-Encrypted: i=1; AJvYcCUw+cj9g93oCxjJpD2B2O3BdYR5cEkvCCGGiXCrsXXavR8vmncXqYg0DlIPXUyNF+Qv+zeNo2x9jsQH@lists.postgresql.org X-Gm-Message-State: AOJu0Yzk3ge7GZwWt9YfD9kMhOokhO4PdFfRli6i3Jmhd2R7rUINKY1N 9C1NO9UL/XifbcDbjODACZM6fjkXgVWxAkQvGxoxbg2cw7V+VSVD139Wdtb2ug== X-Google-Smtp-Source: AGHT+IGWIQJ/CqyH8zH132pk8+xUw9lQoTAtvh7lLPN3/0EAP8fJIqmlpR9EpX/ZM6lSomMTryOUWA== X-Received: by 2002:a05:6808:13d2:b0:3dc:2878:c2d with SMTP id 5614622812f47-3e3c156ca1emr7425273b6e.47.1728330057554; Mon, 07 Oct 2024 12:40:57 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5e7d7148f71sm1641266eaf.28.2024.10.07.12.40.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Oct 2024 12:40:56 -0700 (PDT) Date: Mon, 7 Oct 2024 12:40:54 -0700 From: Noah Misch To: Nathan Bossart Cc: Michael Paquier , Fujii Masao , Christophe Pettus , vaibhave postgres , Tom Lane , pgsql-bugs@lists.postgresql.org, vsekar@microsoft.com Subject: Re: vacuumdb: permission denied for schema "pg_temp_7" Message-ID: <20241007194054.5d@rfd.leadboat.com> References: <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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Oct 07, 2024 at 11:16:33AM -0500, Nathan Bossart wrote: > 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. Not just code consistency. A code comment requires the schema qualification: * Since we execute the constructed query with the default search_path * (which could be unsafe), everything in this query MUST be fully * qualified. > --- 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");