Re: CHECK that involves a function call behaves differently during bulk load?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Kirk Parker <khp(at)equatoria(dot)us>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: CHECK that involves a function call behaves differently during bulk load?
Date: 2025-03-14 00:23:53
Message-ID: 2953758.1741911833@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Thu, Mar 13, 2025 at 3:33 PM Kirk Parker <khp(at)equatoria(dot)us> wrote:
>> (1) why does it work with individual inserts sent via psql, but not with
>> the redirected input from the dump?

> https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATTERNS
> 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-MIGRATION

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Mathew Heard 2025-03-14 00:51:22 Re: BUG #18839: ARMv7 builds fail due to missing __crc32cw and similar
Previous Message Tom Lane 2025-03-14 00:19:42 Re: BUG #18839: ARMv7 builds fail due to missing __crc32cw and similar