Documentation / Extension Hooks
PostgreSQL Extension Hooks
Global extension hooks exported by the PostgreSQL core, with versioned C signatures, definitions and call sites.
Reading PostgreSQL 18.
39 entries; 34 recorded in PostgreSQL 18.
| Name and purpose | Group | Version history |
|---|---|---|
| ClientAuthentication_hookClientAuthentication_hook Hook for plugins to get control in ClientAuthentication() |
Authentication and connections | |
| check_password_hookcheck_password_hook Hook to check passwords in CreateRole() and AlterRole() |
Authentication and connections | |
| ldap_password_hookldap_password_hook hook type for password manglers |
Authentication and connections | |
| openssl_tls_init_hookopenssl_tls_init_hook Call init hook (usually to set password callback) |
Authentication and connections | |
| ExplainOneQuery_hookExplainOneQuery_hook Hook for plugins to get control in ExplainOneQuery() |
EXPLAIN | |
| explain_get_index_name_hookexplain_get_index_name_hook Hook for plugins to get control in explain_get_index_name() |
EXPLAIN | |
| explain_per_node_hookexplain_per_node_hook Hook for EXPLAIN plugins to print extra fields on individual plan nodes |
EXPLAIN | |
| explain_per_plan_hookexplain_per_plan_hook Hook for EXPLAIN plugins to print extra information for each plan |
EXPLAIN | |
| explain_validate_options_hookexplain_validate_options_hook Hook to perform additional EXPLAIN options validation |
EXPLAIN | |
| emit_log_hookemit_log_hook Hook for intercepting messages before they are sent to the server log |
Logging and function calls | |
| fmgr_hookfmgr_hook function manager hook |
Logging and function calls | |
| needs_fmgr_hookneeds_fmgr_hook Hooks for function calls |
Logging and function calls | |
| ProcessUtility_hookProcessUtility_hook Hook for plugins to get control in ProcessUtility() |
Parsing and utility commands | |
| post_parse_analyze_hookpost_parse_analyze_hook Hook for plugins to get control at end of parse analysis |
Parsing and utility commands | |
| ExecutorCheckPerms_hookExecutorCheckPerms_hook Hook for plugins to get control in ExecCheckPermissions() |
Permissions and object access | |
| object_access_hookobject_access_hook Plugin provides a hook function matching one or both of these signatures. |
Permissions and object access | |
| object_access_hook_strobject_access_hook_str object_access_hook_str: core extension hook declared in src/include/catalog/objectaccess.h. The exact interface and call sites are recorded below. |
Permissions and object access | |
| row_security_policy_hook_permissiverow_security_policy_hook_permissive hooks to allow extensions to add their own security policies row_security_policy_hook_permissive can be used to add policies which are combined with the other permissive policies, using OR. row_security_policy_hook_restrictive can be used to add policies which are enforced, regardless of other policies (they are combined using AND). |
Permissions and object access | |
| row_security_policy_hook_restrictiverow_security_policy_hook_restrictive row_security_policy_hook_restrictive: core extension hook declared in src/include/rewrite/rowsecurity.h. The exact interface and call sites are recorded below. |
Permissions and object access | |
| ExecutorEnd_hookExecutorEnd_hook Hook for plugins to get control in ExecutorEnd() |
Query execution | |
| ExecutorFinish_hookExecutorFinish_hook Hook for plugins to get control in ExecutorFinish() |
Query execution | |
| ExecutorRun_hookExecutorRun_hook Hook for plugins to get control in ExecutorRun() |
Query execution | |
| ExecutorStart_hookExecutorStart_hook Hook for plugins to get control in ExecutorStart() |
Query execution | |
| build_simple_rel_hookbuild_simple_rel_hook Not recorded in the selected version. |
Query planningNot recorded | |
| create_upper_paths_hookcreate_upper_paths_hook Hook for plugins to get control when grouping_planner() plans upper rels |
Query planning | |
| get_relation_info_hookget_relation_info_hook Hook for plugins to get control in get_relation_info() |
Query planning | |
| join_path_setup_hookjoin_path_setup_hook Not recorded in the selected version. |
Query planningNot recorded | |
| join_search_hookjoin_search_hook Hook for plugins to replace standard_join_search() |
Query planning | |
| joinrel_setup_hookjoinrel_setup_hook Not recorded in the selected version. |
Query planningNot recorded | |
| planner_hookplanner_hook Hook for plugins to get control in planner() |
Query planning | |
| planner_setup_hookplanner_setup_hook Not recorded in the selected version. |
Query planningNot recorded | |
| planner_shutdown_hookplanner_shutdown_hook Not recorded in the selected version. |
Query planningNot recorded | |
| set_join_pathlist_hookset_join_pathlist_hook Hook for plugins to get control in add_paths_to_joinrel() |
Query planning | |
| set_rel_pathlist_hookset_rel_pathlist_hook Hook for plugins to get control in set_rel_pathlist() |
Query planning | |
| shmem_request_hookshmem_request_hook shmem_request_hook: core extension hook declared in src/include/miscadmin.h. The exact interface and call sites are recorded below. |
Startup and shared memory | |
| shmem_startup_hookshmem_startup_hook Now give loadable modules a chance to set up their shmem allocations |
Startup and shared memory | |
| get_attavgwidth_hookget_attavgwidth_hook Hook for plugins to get control in get_attavgwidth() |
Statistics and estimation | |
| get_index_stats_hookget_index_stats_hook get_index_stats_hook: core extension hook declared in src/include/utils/selfuncs.h. The exact interface and call sites are recorded below. |
Statistics and estimation | |
| get_relation_stats_hookget_relation_stats_hook Hooks for plugins to get control when we ask for stats |
Statistics and estimation |
RecordedFirst recordedInterface or attribute changeNo longer recorded
Squares indicate presence in sampled builds, not first introduction. Select a square for the same-version definition and sources.
Reading this collection
C interfaces can change between major releases. Inspect the declaration and calling code for your target build. Per-object callbacks, GUC callbacks, frontend interfaces and extension-private APIs are outside this inventory.