Re: Index functions and INDEX_CREATE_SKIP_BUILD

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Index functions and INDEX_CREATE_SKIP_BUILD
Date: 2025-12-02 07:54:12
Message-ID: aS6bJGQ4UdVcenM5@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 02, 2025 at 08:18:48AM +0100, Antonin Houska wrote:
> In ReindexRelationConcurrently(), the call of index_concurrently_create_copy()
> is enclosed in
>
> /*
> * Switch to the table owner's userid, so that any index functions are
> * run as that user. Also lock down security-restricted operations
> * and arrange to make GUC variable changes local to this command.
> */
> GetUserIdAndSecContext(&save_userid, &save_sec_context);
> SetUserIdAndSecContext(heapRel->rd_rel->relowner,
> save_sec_context | SECURITY_RESTRICTED_OPERATION);
> save_nestlevel = NewGUCNestLevel();
>
> and
>
> /* Roll back any GUC changes executed by index functions */
> AtEOXact_GUC(false, save_nestlevel);
>
> /* Restore userid and security context */
> SetUserIdAndSecContext(save_userid, save_sec_context);

Yes.

> Which index functions can be called if index_create() receives the
> INDEX_CREATE_SKIP_BUILD flag?

What do you mean here? Are you seeing an issue with that, or are you
asking about a concept that would be introduced by a different patch?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2025-12-02 08:01:06 Re: Buffer locking is special (hints, checksums, AIO writes)
Previous Message jian he 2025-12-02 07:52:57 Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions