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 1qGYS8-0007jg-TM for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jul 2023 05:19:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qGYS7-0002b9-5J for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jul 2023 05:19:51 +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 1qGYS6-0002az-IH for pgsql-hackers@lists.postgresql.org; Tue, 04 Jul 2023 05:19:50 +0000 Received: from mail-yw1-x1134.google.com ([2607:f8b0:4864:20::1134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qGYS3-001vog-UH for pgsql-hackers@postgresql.org; Tue, 04 Jul 2023 05:19:49 +0000 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-579e5d54e68so33774627b3.1 for ; Mon, 03 Jul 2023 22:19:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1688447987; x=1691039987; h=user-agent: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=pohRd3iFWgV1HwE8Ms0ZjmfKUJgamnfUa2Z4RvS+/9Y=; b=IugRnkUwk0cVc1TMiLiNdjIEUUsIR16ts+B8LMPDxMas+L/lSXil3Qj69MVlA+G/Qn 1KNdwhrGupqCZbLJmkItFVrRMUSQBU2Bn7RXMGmpjubjpuaYOLXBOSvdADy6TZ4kt0GE OQYTIvOIp8RMZOJMjU/u74otzt1YYOyHsy9eg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688447987; x=1691039987; h=user-agent: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=pohRd3iFWgV1HwE8Ms0ZjmfKUJgamnfUa2Z4RvS+/9Y=; b=SAWxGt7CpCVRgHHy9vWSCLjbbrReoJy3BfPZ+i1KZGHZZN00gHVoUZ9pLa6OxJEFOy MTmvlGUEQvsvROiiYkCKf7jGaiCteRtdM5CNMwTPNztRgPvDwLVbLtk9nzJd1Z5znFr+ 2Qrmpr3PG8zHWyLl3bgjCJHrf125MFvIYxAILtzquyuAfRNfI+BoPYLITTV7OBZ6GEVP 1ZI+0ustC8MNjsGmlNcOKxVGKGwOwK8ffaVTAMvvGe3zjaAS/U3xbv8xmdXh6dgnwJQ5 YUyKhkSvdL4DkJ2TdTauh2s22FVWyGYduvXoydpw6xJ3hlAXP1qRLWgbWXrjxicGT8j8 pATQ== X-Gm-Message-State: ABy/qLaxvR9BvjkdD5sW+CEmMh7s/DGBlIDxHQINHszqgssTsI8w/4Me TjAY7AITcV6Gljh9+ztZ3sNK42N+G+16vkLiWBA= X-Google-Smtp-Source: APBJJlHVq7kiU3jb23K1+O3s4A9l+gPdWr2sRP2xnySsYHXQcTuuf4Ot1CzMegK9lRNZ6wrWnPP8mw== X-Received: by 2002:a0d:e651:0:b0:577:6313:1643 with SMTP id p78-20020a0de651000000b0057763131643mr10376057ywe.9.1688447987236; Mon, 03 Jul 2023 22:19:47 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::2e]) by smtp.gmail.com with ESMTPSA id g128-20020a0df686000000b005704c4d3579sm5458735ywf.40.2023.07.03.22.19.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2023 22:19:46 -0700 (PDT) Date: Mon, 3 Jul 2023 22:19:43 -0700 From: Noah Misch To: Nathan Bossart Cc: Tom Lane , Jeff Davis , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: pgsql: Fix search_path to a safe value during maintenance operations. Message-ID: <20230704051943.GA3106079@rfd.leadboat.com> References: <4df537f5a0d8c0ceac3eec3809d1144880b8e76d.camel@j-davis.com> <578fb4be80247570e6a05924908765a0b345971e.camel@j-davis.com> <43bbc9f7318057f51552d5986830908cb018dadf.camel@j-davis.com> <1659699.1688086436@sss.pgh.pa.us> <20230630050921.GA2640352@nathanxps13> <20230630183546.GB2828237@nathanxps13> <20230703035731.GA3028728@rfd.leadboat.com> <20230703181914.GA2944898@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230703181914.GA2944898@nathanxps13> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 03, 2023 at 11:19:14AM -0700, Nathan Bossart wrote: > On Sun, Jul 02, 2023 at 08:57:31PM -0700, Noah Misch wrote: > > Another dimension of compromise could be to make MAINTAIN affect fewer > > commands in v16. Un-revert the part of commit 05e1737 affecting just the > > commands it still affects. For example, limit MAINTAIN and the 05e1737 > > behavior change to VACUUM, ANALYZE, and REINDEX. Don't worry about VACUUM or > > ANALYZE failing under commit 05e1737, since they would have been failing under > > autovacuum since 2018. A problem index expression breaks both autoanalyze and > > REINDEX, hence the inclusion of REINDEX. The already-failing argument doesn't > > apply to CLUSTER or REFRESH MATERIALIZED VIEW, so those commands could join > > MAINTAIN in v17. > > I'm open to compromise if others are, but I'm skeptical that folks will be > okay with too much fancy footwork this late in the game. Got it. > Anyway, IMO your argument could extend to CLUSTER and REFRESH, too. If > we're willing to change behavior under the assumption that autovacuum > would've been failing since 2018, then why wouldn't we be willing to change > it everywhere? I suppose someone could have been manually vacuuming with a > special search_path for 5 years to avoid needing to schema-qualify their > index expressions (and would then be surprised that CLUSTER/REFRESH no > longer work), but limiting MAINTAIN to VACUUM, etc. would still break their > use-case, right? Yes, limiting MAINTAIN to VACUUM would still break a site that has used manual VACUUM to work around associated loss of autovacuum. I'm not sympathetic to a user who neglected to benefit from the last five years of prep time on this issue as it affects VACUUM and ANALYZE. REFRESH runs more than index expressions, e.g. function calls in the targetlist of the materialized view query. Those targetlist expressions haven't been putting ERRORs in the log during autovacuum, so REFRESH hasn't had the sort of advance warning that VACUUM and ANALYZE got.