Re: Fix search_path for all maintenance commands - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Fix search_path for all maintenance commands
Date
Msg-id 20230722140438.GA50610@rfd.leadboat.com
Whole thread Raw
In response to Re: Fix search_path for all maintenance commands  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Fix search_path for all maintenance commands  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Fri, Jul 21, 2023 at 03:32:43PM -0700, Jeff Davis wrote:
> Why do we switch to the table owner and use
> SECURITY_RESTRICTED_OPERATION in DefineIndex(), when we will switch in
> index_build (etc.) anyway?

Commit a117ceb added that, and it added some test cases that behaved
differently without that.

> Similarly, why do we switch in vacuum_rel(),
> when it doesn't matter for lazy vacuum and we will switch in
> cluster_rel() and do_analyze_rel() anyway?

It conforms to the "as soon as possible after locking the relation" coding
rule that commit a117ceb wrote into miscinit.c.  That provides future
proofing.



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: doc: improve the restriction description of using indexes on REPLICA IDENTITY FULL table.
Next
From: Pavel Stehule
Date:
Subject: Re: Schema variables - new implementation for Postgres 15