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 1rfNjz-00HKfH-Ns for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Feb 2024 17:29:12 +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 1rfNjx-00DCpQ-Sg for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Feb 2024 17:29:10 +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 1rfNjx-00DCpC-Gr for pgsql-hackers@lists.postgresql.org; Wed, 28 Feb 2024 17:29:10 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rfNjv-001pIa-5i for pgsql-hackers@postgresql.org; Wed, 28 Feb 2024 17:29:09 +0000 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5cddc5455aeso5354835a12.1 for ; Wed, 28 Feb 2024 09:29:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1709141345; x=1709746145; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=6ppgllPU6SUA06/B007LuFzKy+5tG8f7LzBjLw0aJGo=; b=fUJ0UzRjchcMNBpsPfSVGuZe+ByzCJiKA2WW8xie193kn7OovaoMZv2bxl7IrX+Fus tEx8wv13L53cvLZbfQzRDcrG4DexdsOLvygYw8f76j4FL7X43qPDR8afmQtDEcPm/ok6 k3FpnVzxSOhl+JebdgDad3moXoQk1FaTt3kdPDaXw7voCekmSMH8+slyVf/WESAT3DPf MftLxyhWvRZ1qakahRXQ/YbLrx5wdCOvDNOxkvXTiTE7SuSwPnEcEQxEabSF9PjKzoLr YN8z8JzlzRfIacpZDxvYwK/sqfJ3MEv4TO2l0I38R6Q8RJiF72U6oHvUgCC655Yofn2a 9xgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709141345; x=1709746145; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6ppgllPU6SUA06/B007LuFzKy+5tG8f7LzBjLw0aJGo=; b=Fnx7ALSikCyC0pebj725v4Lux111SLs56+WVp1HcvuoRGwUSwmFkiwjur1Oob1P0DD szAGEa1Ki+iARETvim42gW92YJRWXd/Q/nyGd4cy6ihLsVQveV4m6ApzBP5SkIuuqx+P 12CbUDpe+SgvaXeVfMnKhq+Snpc2vefp28ws8rdBhRDuyBenrWkSHC36UbW08orIltfy GFuE6wMJnrpL2NOEjRm9CVZQc7VYJwW7Kk2k4EmxFNvrgGOWmcVGjcnh1K5hkQokrBXe m46gVWSx1LFlZHNVs18xXUpGN8KasS1lcLP3assPPnCmf50ZsBdZWQFWaHYnZh4pw+m5 y/7A== X-Gm-Message-State: AOJu0YyWbhd+Rd2+ZSKZjlnVjSdn5p1Fk8SptWihawkY2PObd1dimu0e OXEn0nKT553gPVqDobggXPPw6gKR7grJpXHKMRIe1dFH1yQ88Igex+mT4AqWLjctu5zSstQNe1U = X-Google-Smtp-Source: AGHT+IGuMdXdsnptJH+/wKQ3jaE8WII1cAXqqGVbG8tg+bauHdmThd422So0jgXo0UTghPmiuFnAZQ== X-Received: by 2002:a05:6a20:d391:b0:1a0:e4c7:294a with SMTP id iq17-20020a056a20d39100b001a0e4c7294amr6529949pzb.7.1709141345368; Wed, 28 Feb 2024 09:29:05 -0800 (PST) Received: from jeff-laptop.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id i23-20020a631317000000b005ce472f2d0fsm7879723pgl.66.2024.02.28.09.29.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:29:04 -0800 (PST) Message-ID: <31ae1bf73e8a1dae3ee7ef2dd43a9bbda1e1ab86.camel@j-davis.com> Subject: Re: MAINTAIN privilege -- what do we need to un-revert it? From: Jeff Davis To: Nathan Bossart Cc: pgsql-hackers@postgresql.org, Joe Conway , Robert Haas Date: Wed, 28 Feb 2024 09:29:04 -0800 In-Reply-To: <20240228165523.GA2435539@nathanxps13> References: <20240214190226.GA373350@nathanxps13> <4d497d82e4516037dc1082d5a62d199ea00d62e7.camel@j-davis.com> <20240223213055.GA1805646@nathanxps13> <196d1c86d43a147e777bb74159774f255dbe73e3.camel@j-davis.com> <20240228165523.GA2435539@nathanxps13> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2024-02-28 at 10:55 -0600, Nathan Bossart wrote: > I'm afraid I don't have a better idea than adding a short note in > each > affected commands's page. OK, that works for now. Later we should also document that the functions are run as the table owner. > > On Fri, 2024-02-23 at 15:30 -0600, Nathan Bossart wrote: > > > I wonder if it's worth using PGC_S_INTERACTIVE or introducing a > > > new > > > value > > > for these. > >=20 > > Did you have a particular concern about PGC_S_SESSION? >=20 > My only concern is that it could obscure the source of the > search_path > change, which in turn might cause confusion when things fail. That's a good point. AutoVacWorkerMain uses PGC_S_OVERRIDE, but it doesn't have to worry about SET, because there's no real session. The function SET clause uses PGC_S_SESSION. It's arguable whether that's really the same source as a SET command, but it's definitely closer. >=20 > Yeah, we would have to make it equivalent in priority to > PGC_S_SESSION, > which would likely require a bunch of special logic. I'm not clear on what problem that would solve. > I don't doubt anything you've said, but I can't help but think that > we > might as well handle the pg_temp risk, too. That sounds good to me, but I didn't get many replies in that last thread. And although it solves the problem, it is a bit awkward. Can we get some closure on whether that !pg_temp patch is the right approach? That was just my first idea, and it would be good to hear what others think. > Furthermore, I see that we use "" as a safe search_path for > autovacuum and > fe_utils/connect.h.=C2=A0 Is there any way to unite these? We could have a single function like RestrictSearchPath(), which I believe I had in some previous iteration. That would use the safest search path (either excluding pg_temp or putting it at the end) and PGC_S_SESSION, and then use it everywhere. Regards, Jeff Davis