10namespace backend_type {
20 autovac_launcher = B_AUTOVAC_LAUNCHER,
21 autovac_worker = B_AUTOVAC_WORKER,
22 bg_worker = B_BG_WORKER,
23 wal_sender = B_WAL_SENDER,
24#if PG_MAJORVERSION_NUM >= 17
25 slotsync_worker = B_SLOTSYNC_WORKER,
26 standalone_backend = B_STANDALONE_BACKEND,
28 archiver = B_ARCHIVER,
29 bg_writer = B_BG_WRITER,
30 checkpointer = B_CHECKPOINTER,
32 wal_receiver = B_WAL_RECEIVER,
33#if PG_MAJORVERSION_NUM >= 17
34 wal_summarizer = B_WAL_SUMMARIZER,
36 wal_writer = B_WAL_WRITER,
49 static backend_type::type
type() {
return static_cast<backend_type::type
>(::MyBackendType); };
57 template <
typename T>
requires requires(T t,
int code) {
61 T *raw_mem = top_memory_context().alloc<T>();
62 T *allocation =
new (raw_mem) T(std::forward<T>(func));
65 [](
int code, ::Datum
datum) {
66 T *func =
reinterpret_cast<T *
>(DatumGetPointer(
datum));
69 PointerGetDatum(allocation));
Backend management.
Definition: backend.hpp:44
static void atexit(T &&func)
Register a callback for when Postgres will be exiting.
Definition: backend.hpp:60
static backend_type::type type()
get current backend type
Definition: backend.hpp:49