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 1tssqE-006QNt-EA for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Mar 2025 00:23:58 +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 1tssqD-009ize-5k for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Mar 2025 00:23:57 +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 1tssqC-009izT-TO for pgsql-bugs@lists.postgresql.org; Fri, 14 Mar 2025 00:23:56 +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 1tssqA-002hYN-2y for pgsql-bugs@lists.postgresql.org; Fri, 14 Mar 2025 00:23:56 +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 52E0Nrob2953759; Thu, 13 Mar 2025 20:23:53 -0400 From: Tom Lane To: "David G. Johnston" cc: Kirk Parker , PostgreSQL mailing lists Subject: Re: CHECK that involves a function call behaves differently during bulk load? In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Thu, 13 Mar 2025 15:52:42 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2953757.1741911833.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 13 Mar 2025 20:23:53 -0400 Message-ID: <2953758.1741911833@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Thu, Mar 13, 2025 at 3:33=E2=80=AFPM Kirk Parker w= rote: >> (1) why does it work with individual inserts sent via psql, but not wit= h >> the redirected input from the dump? > https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PAT= TERNS > System maintenance and actions use a secure search_path. Even more to the point, see the first compatibility entry at [1]: * Change functions to use a safe search_path during maintenance operations (Jeff Davis) This prevents maintenance operations (ANALYZE, CLUSTER, CREATE INDEX, CREATE MATERIALIZED VIEW, REFRESH MATERIALIZED VIEW, REINDEX, or VACUUM) from performing unsafe access. Functions used by expression indexes and materialized views that need to reference non-default schemas must specify a search path during function creation. regards, tom lane [1] https://www.postgresql.org/docs/17/release-17.html#RELEASE-17-MIGRATIO= N