Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qK2Ou-0008DY-N9 for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jul 2023 19:54:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qK2Os-0004Yw-Jg for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jul 2023 19:54:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qK2Os-0004Wb-63 for pgsql-hackers@lists.postgresql.org; Thu, 13 Jul 2023 19:54:54 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qK2Oj-000F71-Lx for pgsql-hackers@postgresql.org; Thu, 13 Jul 2023 19:54:52 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-51e28cac164so5001546a12.1 for ; Thu, 13 Jul 2023 12:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=singh-im.20221208.gappssmtp.com; s=20221208; t=1689278085; x=1691870085; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=bZk67tws/3XipFbVpn1g5klt2IAbUYV+IkDKp88rM/Y=; b=j60z8CTQpCs5Sw+ExhuKmZJvgGcKiA6VgYemnbR4yQv5pmYmWczYcWpr7/8m4ShWk4 dbh2ZibSTOZjFdyl/ZMhYEFfGw//w38xHgKTyvIvMcwHmNPCd5TUyD/wF3AZm3/s6fn2 aIslNIxH6gxf5EoDdbXdBRjCTewD5+XjE1cheI3oWL1aWKaTiD7998gNFNclDcY2QYQq 0iRYpolfy6rF+k2ANfW+d3M6RpqIAC/UAcSzMFgKHFvZqmNwbKPb7oRwnVAVAPnenhMV npkJ7crGQm3GdpMkl6sYrUgyIUKkLCkgBn/9l7YwRglU3IZFDFCE9nWSCYtLsjFpO8AM xM3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689278085; x=1691870085; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bZk67tws/3XipFbVpn1g5klt2IAbUYV+IkDKp88rM/Y=; b=FD6iykQMrCJXeLDlsjb+LercjF5hBfXIUDeGB7qyitEXuBygJhXUF1+WU8QAuyta6k 8RJOlndIz2grkSyRK4e8KnJaNVViNBLwPJrENPK+mBAmyqQ5hk4sPKmKgS0KzjG2kdrL RbYfv1HEEwHUeORv9EPp9OAotxMyomiD9oBn26mgBG3ZyOIjBX1RuE16ReaSEcMJov83 K2u64Wlj9kGCWTAs4RZ8f3FykYeZuFcj/pRhmK7BR1xO1AzTlnQDC5BbKaAfx+70P8er TPwuNWALLm7V6+9cwBfpBgQTTsYUIDdCYXIR/GMmqZRqNuuWe98M58CUPpbaYfgXlu08 KbJA== X-Gm-Message-State: ABy/qLbRG9EgY0+qn2riuOSoSCf+e/eK9x+d6UTePeSAKtuxUzKVafK6 gtrgI6pm/0x9KFqonwz1Ak5bBO8aOHteZWnUHs4= X-Google-Smtp-Source: APBJJlGSMp1vMTPcMNlcc32JzsQMB+DdatBo1/fU1xdPALoigKeIaBN9fsLAJculATdBDp36c/XTTpCIfGhtrb0+nSE= X-Received: by 2002:aa7:d81a:0:b0:51e:421e:d209 with SMTP id v26-20020aa7d81a000000b0051e421ed209mr761992edq.13.1689278084249; Thu, 13 Jul 2023 12:54:44 -0700 (PDT) MIME-Version: 1.0 References: <2cf41c8edeaaf7acb757095e6eceab8ae926f3da.camel@j-davis.com> In-Reply-To: <2cf41c8edeaaf7acb757095e6eceab8ae926f3da.camel@j-davis.com> From: Gurjeet Singh Date: Thu, 13 Jul 2023 12:54:26 -0700 Message-ID: Subject: Re: Fix search_path for all maintenance commands To: Jeff Davis Cc: pgsql-hackers@postgresql.org, Nathan Bossart , Robert Haas , Noah Misch , "David G. Johnston" , Greg Stark , Tom Lane Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jul 13, 2023 at 11:56=E2=80=AFAM Jeff Davis wro= te: > > The current approach seemed to get support from Noah, Nathan, and Greg > Stark. > > Concerns were raised by Gurjeet, Tom, and Robert in the 16 cycle; but I didn't see Tom's or Robert's concerns raised in this thread. I see now that for some reason there are two threads with slightly different subjects. I'll catch-up on that, as well. The other thread's subject: "pgsql: Fix search_path to a safe value during maintenance operations" > I'm not sure whether those objections were specific to the 16 cycle or > whether they are objections to the approach entirely. Comments? The approach seems good to me. My concern is with this change's potential to cause an extended database outage. Hence sending it out as part of v16, without any escape hatch for the DBA, is my objection. It it were some commercial database, we would have simply introduced a hidden event, or a GUC, with default off. But a GUC for this feels too heavy handed. Perhaps we can provide an escape hatch as follows (warning, pseudocode ahea= d). > if (first_element(search_path) !=3D "dont_override_search_patch_for_maint= enance") > SetConfigOption("search_path", GUC_SAFE_SEARCH_PATH, ...); So, if someone desperately wants to just plow through the maintenance command, and are not ready or able to fix their dependence on their search_path, the community can show them this escape-hatch. Best regards, Gurjeet http://Gurje.et