Re: pgsql: Fix search_path to a safe value during maintenance operations.

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Jeff Davis <jdavis(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix search_path to a safe value during maintenance operations.
Date: 2023-06-10 00:49:00
Message-ID: 053b43a9f80793a8f31467ba9de3db90518ab120.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2023-06-10 01:04:52 pgsql: doc: PG 16 relnotes, add author
Previous Message Jeff Davis 2023-06-10 00:37:57 Re: pgsql: Fix search_path to a safe value during maintenance operations.

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2023-06-10 01:04:36 Re: PG 16 draft release notes ready
Previous Message Gregory Smith 2023-06-10 00:41:50 Re: Use COPY for populating all pgbench tables