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

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Jeff Davis <jdavis(at)postgresql(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix search_path to a safe value during maintenance operations.
Date: 2024-03-05 16:19:35
Message-ID: 202403051619.jiuwd3ec4jmi@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2024-Mar-05, Jeff Davis wrote:

> Fix search_path to a safe value during maintenance operations.
>
> While executing maintenance operations (ANALYZE, CLUSTER, REFRESH
> MATERIALIZED VIEW, REINDEX, or VACUUM), set search_path to
> 'pg_catalog, pg_temp' to prevent inconsistent behavior.
>
> Functions that are used for functional indexes, in index expressions,
> or in materialized views and depend on a different search path must be
> declared with CREATE FUNCTION ... SET search_path='...'.

This appears to have upset the sepgsql tests. In buildfarm member
rhinoceros there's now a bunch of errors like this

ALTER TABLE regtest_table_4
ADD CONSTRAINT regtest_tbl4_con EXCLUDE USING btree (z WITH =);
+LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=unconfined_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="regtest_schema" permissive=0
+LOG: SELinux: allowed { search } scontext=unconfined_u:unconfined_r:sepgsql_regtest_superuser_t:s0 tcontext=system_u:object_r:sepgsql_schema_t:s0 tclass=db_schema name="public" permissive=0

in its ddl.sql test. I suppose this is just the result of the internal
change of search_path. Maybe the thing to do is just accept the new
output as expected.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Voy a acabar con todos los humanos / con los humanos yo acabaré
voy a acabar con todos (bis) / con todos los humanos acabaré ¡acabaré! (Bender)

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-03-05 16:31:23 pgsql: Fix references to renamed function in comments
Previous Message Peter Eisentraut 2024-03-05 12:43:11 pgsql: Improve field order in RangeTblEntry

Browse pgsql-hackers by date

  From Date Subject
Next Message Amonson, Paul D 2024-03-05 16:31:15 RE: Popcount optimization using AVX512
Previous Message Nathan Bossart 2024-03-05 16:12:35 un-revert the MAINTAIN privilege and the pg_maintain predefined role