↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Documentation / Extension Hooks / EXPLAIN

explain_get_index_name_hook

explain_get_index_name_hook

Hook for plugins to get control in explain_get_index_name()

Reading PostgreSQL 18.

Description

Hook for plugins to get control in explain_get_index_name()

Interface type
explain_get_index_name_hook_type
Header
src/include/commands/explain.h
Subsystem
EXPLAIN
Initial value
NULL (no hook installed)

C interface

typedef const char *(*explain_get_index_name_hook_type) (Oid indexId);
extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook;

Call sites

src/backend/commands/explain.c:4027

Core call context: src/backend/commands/explain.c:4021–4035

static const char *
explain_get_index_name(Oid indexId)
{
	const char *result;

	if (explain_get_index_name_hook)
		result = (*explain_get_index_name_hook) (indexId);
	else
		result = NULL;
	if (result == NULL)
	{
		/* default behavior: look it up in the catalogs */
		result = get_rel_name(indexId);
		if (result == NULL)
			elog(ERROR, "cache lookup failed for index %u", indexId);

Related entries

Documentation and source

Source build
Version
18
Build
REL_18_STABLE
Source fingerprint
753057e340da8f22e57c9a409ea7a235fd6a46bd

Related entries

Back to Extension Hooks · Recorded in PostgreSQL 10 through 20; the first sample is not necessarily its introduction.