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 1r0Tuk-005s9b-LS for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Nov 2023 21:47:14 +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 1r0Tui-00CeGc-6K for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Nov 2023 21:47:12 +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 1r0Tuh-00CeGU-Pm for pgsql-hackers@lists.postgresql.org; Tue, 07 Nov 2023 21:47:11 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r0Tuf-005Exv-Gn for pgsql-hackers@postgresql.org; Tue, 07 Nov 2023 21:47:11 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6b1d1099a84so6169953b3a.1 for ; Tue, 07 Nov 2023 13:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1699393627; x=1699998427; 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=f7K+hdnOXn50RcCxuex7SwgyrJ7iqKx9bTYdD4bJ0ik=; b=tIimCVWhOk889MFTCh+pR+yWqg5sugso8W1D50nCT1mzr5ZO7XSyxR/P4GRIb7wNXj bIUWG54quRjc7MrQOg5hmvZZe1nS08T00BR8A1fBV+h8XPy3XptQyqfwL0QU9MVrwjYD g+SBBiKnCEVBo1DpMpXGpUJ8J58gh1cMH0QBgNOTHGmi62/z5zKAWlhhESZbauWPv5U/ 8h91pFWdB9ljrpDKBBJWzmV8shq+dSlztoUw7qEMXOghYfwX0yUs94DMFvlUr4qW6Qd3 dChpbhGSM5tDWQKQ+r1PlB4feoPR6EfE4NuKlJW2q7uiZEINSxsmzHHWMwsIkoZybYs4 XaAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699393627; x=1699998427; 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=f7K+hdnOXn50RcCxuex7SwgyrJ7iqKx9bTYdD4bJ0ik=; b=Q1zc8udXzEdEEOW/DFcsJsS1Wy8YunEOm66Pr8ewPzqFXTh+MPOEOsTUxE/TuNRP6h kbFSMD8UByxNhpUx+qlBdxkSH5xXTbrRr8KevgYgk01Z/rD9Ak37JkMLI7V/z5uwEjbp +ylnX1tbhKZSYQ2YyBYdDNKWX4/OTJ5WK1y170+KIK4gACpOzaJfGsPLisUI2eBwv38G xcJhGA4b61NliaSsVV27axf9n9YCnxC/rnfmBekzmilmlUzyzdTU2yUsNnix1/GOLbg2 0RE0YPEOmonDhsUnFiYb/Ztj+Vm+JvnjivRGWSWLyWXoFE7IHn1f+b1rU95V89YoAdlV KX2g== X-Gm-Message-State: AOJu0YwMzY2gWSt5bpYYVrKbIAJH6Mo5vPJXEqx3RymbfQq4qwa/etGO My0ATFghcPOBa6LYIBqy5yBGQg== X-Google-Smtp-Source: AGHT+IF59rWUt4egX+ahxbNYup0sfz1Ea5kaMQGDHZr0sSzd2/kQ1XwnrM7qlbLcrGAXZv20F9wEcg== X-Received: by 2002:a05:6a21:7891:b0:180:ebec:da31 with SMTP id bf17-20020a056a21789100b00180ebecda31mr297332pzc.8.1699393626864; Tue, 07 Nov 2023 13:47:06 -0800 (PST) Received: from [172.18.10.36] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id g5-20020a056a00078500b0068ffb8da107sm7634717pfu.212.2023.11.07.13.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 13:47:06 -0800 (PST) Message-ID: <1cb41fed6554739b0adc04602a7f63af0ceee4f0.camel@j-davis.com> Subject: Re: Fix search_path for all maintenance commands From: Jeff Davis To: Isaac Morland Cc: Nathan Bossart , Noah Misch , "David G. Johnston" , Gurjeet Singh , pgsql-hackers@postgresql.org, Robert Haas , Greg Stark , Tom Lane Date: Tue, 07 Nov 2023 13:47:05 -0800 In-Reply-To: References: <2cf41c8edeaaf7acb757095e6eceab8ae926f3da.camel@j-davis.com> <20230715211333.GB3675150@rfd.leadboat.com> <20230717175813.GA717781@nathanxps13> <2ad1dd4e5be5567c0d75676b348eab33b529e974.camel@j-davis.com> 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 Tue, 2023-10-31 at 13:16 -0400, Isaac Morland wrote: > Perhaps the search_path for running a maintenance command should be > the search_path set for the table owner (ALTER ROLE =E2=80=A6 SET search_= path > =E2=80=A6)? After some thought, I don't think that's the right approach. It adds another way search path can be changed, which adds to the complexity. Also, by default it's "$user", public; and given that "public" was world-writable until recently, that doesn't seem like a good idea for a change intended to prevent search_path manipulation. Regards, Jeff Davis