![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
WAL-logging the circuit store: the entry points other files use. More...
#include "postgres.h"

Go to the source code of this file.
Functions | |
| void | provsql_register_rmgr (void) |
| Register ProvSQL's resource manager with PostgreSQL. | |
| void | provsql_wal_log_store_message (const char *data, size_t len) |
| Write one store message to the WAL, if WAL logging is on. | |
| bool | provsql_store_write_allowed (void) |
| Whether this process may write to the circuit store. | |
| void | provsql_replay_store_message (const char *data, size_t len) |
| Feed a logged store message back to the worker. | |
Variables | |
| bool | provsql_wal_logging |
| Global variable set by the provsql.wal_logging run-time configuration parameter: when true, every mutation of the circuit store is written to the WAL before it is written to the store. | |
WAL-logging the circuit store: the entry points other files use.
See provsql_rmgr.c for what is logged, what replay does with it, and why the feature is off by default.
Definition in file provsql_rmgr.h.
| void provsql_register_rmgr | ( | void | ) |
Register ProvSQL's resource manager with PostgreSQL.
Must be called from _PG_init under shared_preload_libraries, and is called unconditionally – registration is what lets any WAL that already contains ProvSQL records be replayed, whether or not this cluster is currently writing them. A no-op before PostgreSQL 15.
Definition at line 184 of file provsql_rmgr.c.

| void provsql_replay_store_message | ( | const char * | data, |
| size_t | len ) |
Feed a logged store message back to the worker.
Implemented in provsql_mmap.c, where the IPC primitives live.
Definition at line 341 of file provsql_mmap.c.

| bool provsql_store_write_allowed | ( | void | ) |
Whether this process may write to the circuit store.
False in a hot-standby backend: the standby's store is maintained by replay, and a backend writing to it would make the two diverge for good. True in the startup process while it replays a ProvSQL record, which is the one write recovery is supposed to make.
Definition at line 192 of file provsql_rmgr.c.

| void provsql_wal_log_store_message | ( | const char * | data, |
| size_t | len ) |
Write one store message to the WAL, if WAL logging is on.
| data | The complete message, starting with its opcode byte. |
| len | Its length in bytes. |
Definition at line 186 of file provsql_rmgr.c.

|
extern |
Global variable set by the provsql.wal_logging run-time configuration parameter: when true, every mutation of the circuit store is written to the WAL before it is written to the store.
Definition at line 182 of file provsql_rmgr.c.