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 1q7mmy-0004QD-Ky for pgsql-committers@arkaria.postgresql.org; Sat, 10 Jun 2023 00:49:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q7mmx-00045t-2i for pgsql-committers@arkaria.postgresql.org; Sat, 10 Jun 2023 00:49:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7mmw-00045k-RX for pgsql-committers@lists.postgresql.org; Sat, 10 Jun 2023 00:49:06 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q7mmu-001JUM-2q for pgsql-committers@lists.postgresql.org; Sat, 10 Jun 2023 00:49:05 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-256d1b5f7c0so1106874a91.1 for ; Fri, 09 Jun 2023 17:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20221208.gappssmtp.com; s=20221208; t=1686358142; x=1688950142; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=fk1CqJLJJmKd9VrditEXiN6+2+O4OKtT7JuX5FfXUAU=; b=HJo1W4Xvtj0BzJxys8DO31wCIv0gnkWEN4yJ7XPeNrPWrG66BUR8SM5gmy2JcFbEQz /U5NYzsQwmPOwDGmkhSrqA0EuAFvnxHI2/AVpL+sphYx6ACeRZC6rEpJ1ZUW7U0xx/p+ 6Cql0+llk3H/uG/5XWCYwIK8L7ZtW01z+3S97z1e6qCQCy0WFxyCI9nUNIzzFzVXBOSn n7YV8uG3fWaTOC2gOZ4fWOi9Od3RMztMzYHfYyYACbQA63RA8ojC2TRBvtyDj/lWYV9Z veiF3EV6rIki7yIZQ2SAQJ746ZBCfK49TVTCFtSKbE5BUJ6y58b7uxMoEnvDmAsI8L7s 9D5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686358142; x=1688950142; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fk1CqJLJJmKd9VrditEXiN6+2+O4OKtT7JuX5FfXUAU=; b=jyYVl5WNaJ0KfeG6Gpsan0IWBRvHluf3wXsxT0/UGcPn+q2s9IpL5V5w5bC71xVlcc LWAlnZCaEGa/6MSuGjxw9EkjSipiXJnGNH3YOyBr8k7VtWqmj3uO6qOMGopLWnl4dpYI 9X4MopeWwP1+1amqatq9OHb3oE4gIHM2SS1Jz3w2m50O4aRdGP81XghAElEDZehHDsz8 //e7QViQNSPLg+2+YZoIk2DU8GrMCmvl5QMCacCBlGEdupcjlKQN1KRKCliFxFV6h7zK WiJVkEVgx2VHV1Dv3TnGAvsQh+LY1Q9O1iSrNIFg/SkBYaY1zzP3rN05dA97c5agRDwA 9M/w== X-Gm-Message-State: AC+VfDxGmg3ffJ52w7WvPc07mNbtwBk+ltz3c0OZ8/FXpmx2RR4BHWGe w5wwThytQpZZ1wVBSaR76nkHOQ== X-Google-Smtp-Source: ACHHUZ66jenhmNzk9D9XXOMsC5MR9Tw+lzvKQw3aPFQks9iJozyP5IoycWr7ZA1ml1Ruu7T4GmflYQ== X-Received: by 2002:a17:90a:5c:b0:259:12b2:84ef with SMTP id 28-20020a17090a005c00b0025912b284efmr3837277pjb.13.1686358141985; Fri, 09 Jun 2023 17:49:01 -0700 (PDT) Received: from jeff-laptop.lan (c-73-170-46-202.hsd1.ca.comcast.net. [73.170.46.202]) by smtp.gmail.com with ESMTPSA id rj6-20020a17090b3e8600b002599ef80ab9sm5267746pjb.3.2023.06.09.17.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 17:49:01 -0700 (PDT) Message-ID: <053b43a9f80793a8f31467ba9de3db90518ab120.camel@j-davis.com> Subject: Re: pgsql: Fix search_path to a safe value during maintenance operations. From: Jeff Davis To: Jeff Davis , pgsql-committers@lists.postgresql.org Date: Fri, 09 Jun 2023 17:49:00 -0700 In-Reply-To: References: <89a415b86d5421941e4281ba5bf6288934078624.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2023-06-09 at 17:37 -0700, Jeff Davis wrote: > Attached a patch to mark those functions as PARALLEL UNSAFE, which > fixes the problem. On second thought, that might not be acceptable for amcheck, depending on how its run. I think it's OK if run by pg_amcheck, because that runs it on a single index at a time in each connection, and parallelizes by opening more connections. But if some users are calling the check functions across many tables in a single select statement (e.g. in the targetlist of a query on pg_class), then they'll experience a regression. > Alternatively, I could just take out that line, as those SQL > functions > are not controlled by the MAINTAIN privilege. But for consistency I > think it's a good idea to leave it in so that index functions are > called with the right search path for amcheck. If marking them PARALLEL UNSAFE is not acceptable, then this seems like a fine solution. Regards, Jeff Davis