Skip to content
프로젝트

소개

Unofficial documentation for PostgreSQL hooks

데이터 및 분석

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Postgresql hooks documentation

Unofficial documentation for PostgreSQL hooks.

Denial of responsibility:

This work is not a part of the official PostgreSQL documentation.

Contents of this repository were compiled by Begishev Nikita and Goncharov Vladimir, neither of whom appear to be a developer or a maintainer of the PostgreSQL Database Management System.

Use this documentation at your own risk.

Copyright notice:

This work combines some research made by contributors with information acquired from the postgres source code, comments and documentation. Some contents of this work were copied from source code comments as is, others were written from scratch.

In no way we (Begishev Nikita and Goncharov Vladimir) claim copyright on texts that were copied or adapted from the sources described above.

This work is distributed under the terms of the PostgreSQL License, a copy of which may be found in the file called 'License.md'.

PostgreSQL hooks are a simple way to extend functionality of the database. They allow extensions to introspect database state, react to events and interfere with database operations.

In terms of the programming language, each hook is a pointer to a function of a specific type, initially set to be NULL.

Upon init, database extensions are free to overwrite those function pointers with their own values. A previous value of the overwritten pointer is usually stored withing the extension local memory.

During its work, postgres checks whether certain function pointers are not null and if that's the case, calls them.

See the detailed description for an explanation on how to implement a hook and an example.

General Hooks

  • emit_log_hook — hook for intercepting messages before they are sent to the server log.
  • shmem_startup_hook — hook for extensions to initialize their shared memory.

Security Hooks

Function Manager Hooks

  • needs_fmgr_hook — auxiliary hook which decides whether fmgr_hook should be applied to a function.
  • fmgr_hook — hook for controlling function execution process.

Planner Hooks

Executor Hooks

PL/pgsql Hooks

  • func_setup — hook for intercepting PLpgSQL function pre-init phase.
  • func_beg — hook for intercepting post-init phase.
  • func_end — hook for intercepting end of a function.
  • stmt_beg — called before each statement of a function.
  • stmt_end — called after each statement of a function.

관련 프로젝트 살펴보기

불러오는 중…