postgresql/contrib/amcheck
Jeff Davis 2af07e2f74 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 change was previously committed as 05e1737351, then reverted in
commit 2fcc7ee7af because it was too late in the cycle.

Preparation for the MAINTAIN privilege, which was previously reverted
due to search_path manipulation hazards.

Discussion: https://postgr.es/m/d4ccaf3658cb3c281ec88c851a09733cd9482f22.camel@j-davis.com
Discussion: https://postgr.es/m/E1q7j7Y-000z1H-Hr%40gemulon.postgresql.org
Discussion: https://postgr.es/m/e44327179e5c9015c8dda67351c04da552066017.camel%40j-davis.com
Reviewed-by: Greg Stark, Nathan Bossart, Noah Misch
2024-03-04 17:31:38 -08:00
..
expected Teach contrib/amcheck to check the unique constraint violation 2023-10-28 00:21:23 +03:00
sql Teach contrib/amcheck to check the unique constraint violation 2023-10-28 00:21:23 +03:00
t Fix search_path to a safe value during maintenance operations. 2024-03-04 17:31:38 -08:00
.gitignore Add .gitignore to contrib/amcheck. 2017-03-09 22:45:24 -05:00
amcheck--1.0--1.1.sql Add amcheck verification of heap relations belonging to btree indexes. 2018-03-31 19:52:01 -07:00
amcheck--1.0.sql Add amcheck extension to contrib. 2017-03-09 16:33:02 -08:00
amcheck--1.1--1.2.sql Allow amcheck to re-find tuples using new search. 2019-03-20 10:41:36 -07:00
amcheck--1.2--1.3.sql Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
amcheck--1.3--1.4.sql Teach contrib/amcheck to check the unique constraint violation 2023-10-28 00:21:23 +03:00
amcheck.control Teach contrib/amcheck to check the unique constraint violation 2023-10-28 00:21:23 +03:00
Makefile amcheck: Distinguish interrupted page deletion from corruption. 2023-10-30 14:46:05 -07:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
verify_heapam.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
verify_nbtree.c Fix search_path to a safe value during maintenance operations. 2024-03-04 17:31:38 -08:00