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 1tk38a-00GvR2-2m for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Feb 2025 15:34:24 +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 1tk38Y-00GyfL-Hf for pgsql-bugs@arkaria.postgresql.org; Mon, 17 Feb 2025 15:34:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tk38Y-00GydS-8S for pgsql-bugs@lists.postgresql.org; Mon, 17 Feb 2025 15:34:22 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tk38W-001Krp-0t for pgsql-bugs@lists.postgresql.org; Mon, 17 Feb 2025 15:34:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 51HFYGom823492; Mon, 17 Feb 2025 10:34:16 -0500 From: Tom Lane To: Kanitchet Vaiassava cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: (Bug? or Intended?) Inconsistent search_path Behavior in Function Calls via Materialized View in PostgreSQL 17 In-reply-to: References: Comments: In-reply-to Kanitchet Vaiassava message dated "Mon, 17 Feb 2025 15:10:42 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <823490.1739806456.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 17 Feb 2025 10:34:16 -0500 Message-ID: <823491.1739806456@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Kanitchet Vaiassava writes: > Actual Behavior (postgres 17) > * Calling the function directly works fine (search_path =3D public). > * Calling the function through a Materialized View defaults search_p= ath to pg_catalog, pg_temp, causing it to fail to find tables This is an intentional change in v17. > * PostgreSQL=C2=92s security model in newer versions (15+) might enf= orce a stricter search_path default (pg_catalog, pg_temp) inside Materiali= zed View refresh execution ???? (which I have not found in web's document) It's the first compatibility issue listed in the v17 release notes: https://www.postgresql.org/docs/17/release-17.html#RELEASE-17-MIGRATION regards, tom lane