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 1st6Um-00DabH-RW for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Sep 2024 14:26:29 +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 1st6Ul-008aiD-Va for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Sep 2024 14:26:27 +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 1st6Ul-008agY-KD for pgsql-bugs@lists.postgresql.org; Tue, 24 Sep 2024 14:26:27 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1st6Ui-000p0k-WC for pgsql-bugs@lists.postgresql.org; Tue, 24 Sep 2024 14:26:26 +0000 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-82ab349320fso210318639f.1 for ; Tue, 24 Sep 2024 07:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727187984; x=1727792784; 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=1dKHq93hMdBZRzHaWxe28e+Mc8BH9XbV5jxTRlt7cso=; b=gSx3ocksjEHSqTmE32/NKdyyCrhytQgbJHiPCUymFIrjgOAmOxo7bTvNZuhEI4iXf7 d8WilLmdkw2OVM7MycxAcfbTqBGfJ/zDleIgowl3bRvn98+qHndni86p5yeiufFHPqqx inSJAMkKESbmzi+AdRDLkSFvmHYeaa3LXaYfbXpVYrRQTd/x8HgSgi4CQC/JfF2PYGH8 Dy2+PTrC9Gl2zJLwZNCpq8kkTrIj8d8US19zs7Sn1NAQAw8yYZP29alpfuXin2Mlev5K qFnXO1QKSusVIaC1qSZSKZbkRmz4lN2yUy8YHOQJ2rnSV5F6uhJejp477CFz3cQw7+aM bBgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727187984; x=1727792784; 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=1dKHq93hMdBZRzHaWxe28e+Mc8BH9XbV5jxTRlt7cso=; b=LD4snJRYU/sAkbljQVQRe4Skf9nwO5S2QamXd3PuTaIYa+GKbBcslU1Z/vhNYn2UKL an2uc2gkCg6bW1yRKh2p0nXeAq51vWGMB9qgZqQQ3Z3vCH4FuBnSCrtWHiO4XMkZLh01 mRSShJCNRQ3sgZRafjp+JfLds3wm92Q9cV0gu9JkQjpwufETLUz6OTpNf+mUtT6TQODJ yz4kN6x5k7xQJhbc3BcY71n6uscKuzan1yaLdNUC+s9kfImz64/6T4Hju5EfVoVkzAcy cwK3g45itWjMwTsTeB5e/fbt/MAlL01KTABytw0uMV9yHq6gp7PGuUvAt/bVTUPM1I8p VDTw== X-Forwarded-Encrypted: i=1; AJvYcCXh8zlfqsdWOBrMTHlZHwl5x/7XmrvVAwaOOA6ZMtUUWi5WqKMpO9KaJJp4YLjU+c/xYbrjqu9miOJ+@lists.postgresql.org X-Gm-Message-State: AOJu0YwoacC8D7TeEbW5lz70JSlBnWDb4q9v14l8JAJabWp2TZfxRttv wYqy3KOXJ/er0OjZ6xjjoT2qi6TR5M5GxECuxyBFnWSC8x/UjkzXhhvXpA== X-Google-Smtp-Source: AGHT+IGDbfZyruqIy+vMj06/zaOEkegMZz1h7VGlX+hgaRLFCZxlrPTZ7JNm3EnGlo3rfOs7n23fUg== X-Received: by 2002:a92:1941:0:b0:3a1:a3bd:adcc with SMTP id e9e14a558f8ab-3a1a3bdc4f5mr23363355ab.6.1727187983985; Tue, 24 Sep 2024 07:26:23 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4d40f1bc784sm437516173.112.2024.09.24.07.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 07:26:23 -0700 (PDT) Date: Tue, 24 Sep 2024 09:26:21 -0500 From: Nathan Bossart To: Fujii Masao Cc: Michael Paquier , 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: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00d98a9f-bec1-4cd0-b59e-1043ae04c8bc@oss.nttdata.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Sep 24, 2024 at 11:20:43PM +0900, Fujii Masao wrote: > On 2024/09/24 10:08, Michael Paquier wrote: >> About the permission restrictions depending on the objects listed, the >> filtering query uses currently a list of VALUES in a CTE. Perhaps it >> would be more elegant to switch that to a SELECT with some >> has_schema_privilege() for the cases where OBJFILTER_SCHEMA is >> used? >> >> There permission checks with USAGE and MAINTAIN are broader, so I'd >> choose to add a skip on the temp persistence first and backpatch it >> down to 12 as there is also a performance argument. Then tackle the >> rest by reworking the VALUES part in the CTE. > > Are you suggesting that any objects a user lacks sufficient privileges for > should be silently excluded from vacuuming? This could make vacuumdb appear > successful because no errors occur, but some tables the user intended to > vacuum might be skipped without notice. That seems more problematic to me. Yeah, this is what I mentioned upthread [0]. If the user doesn't specify anything in --table or --schema, then it's probably fine to silently skip objects for which they lack privileges. But if they do explicitly specify a table or schema that they cannot vacuum, then IMHO it'd be better to fail. [0] https://postgr.es/m/Zu3iMzfiGBTbg3iy%40nathan -- nathan