![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Core types, constants, and utilities shared across ProvSQL. More...
#include "pg_config.h"#include "c.h"#include "postgres.h"#include "utils/uuid.h"#include "postgres_ext.h"#include "nodes/pg_list.h"#include "provsql_error.h"

Go to the source code of this file.
Classes | |
| struct | pg_uuid_t |
| UUID structure. More... | |
| struct | constants_t |
| Structure to store the value of various constants. More... | |
| struct | database_constants_t |
| Structure to store the value of various constants for a specific database. More... | |
Macros | |
| #define | UUID_LEN 16 |
| Number of bytes in a UUID. | |
Enumerations | |
| enum | gate_type { gate_input , gate_plus , gate_times , gate_monus , gate_project , gate_zero , gate_one , gate_eq , gate_agg , gate_semimod , gate_cmp , gate_delta , gate_value , gate_mulinput , gate_update , gate_invalid , nb_gate_types } |
| Possible gate type in the provenance circuit. More... | |
Functions | |
| constants_t | get_constants (bool failure_if_not_possible) |
| Retrieve the cached OID constants for the current database. | |
| Oid | find_equality_operator (Oid ltypeId, Oid rtypeId) |
| Find the equality operator OID for two given types. | |
Variables | |
| const char * | gate_type_name [] |
| Names of gate types. | |
| bool | provsql_interrupted |
| Global variable that becomes true if this particular backend received an interrupt signal. | |
| bool | provsql_where_provenance |
| Global variable that indicates if where-provenance support has been activated through the provsql.where_provenance run-time configuration parameter. | |
| int | provsql_verbose |
| Global variable that indicates the verbosity level set by the provsql.verbose_level run-time configuration parameter was set. | |
Core types, constants, and utilities shared across ProvSQL.
This header is included by virtually every source file in the extension. It provides:
gate_type enumeration listing all circuit-gate kinds recognised by ProvSQL (input, semiring operations, aggregation, etc.)constants_t structure caching PostgreSQL OIDs for the types, functions, and operators that ProvSQL installs, so that OID lookups happen once per session rather than on every query.database_constants_t wrapper for per-database OID caches.provsql_error.h for the provsql_error / provsql_warning / provsql_notice / provsql_log macros. Definition in file provsql_utils.h.
| #define UUID_LEN 16 |
Number of bytes in a UUID.
Definition at line 30 of file provsql_utils.h.
| enum gate_type |
Possible gate type in the provenance circuit.
Definition at line 45 of file provsql_utils.h.
| Oid find_equality_operator | ( | Oid | ltypeId, |
| Oid | rtypeId | ||
| ) |
Find the equality operator OID for two given types.
Searches pg_operator for the = operator that accepts ltypeId on the left and rtypeId on the right.
| ltypeId | OID of the left operand type. |
| rtypeId | OID of the right operand type. |
InvalidOid if none is found. Definition at line 109 of file provsql_utils.c.


| constants_t get_constants | ( | bool | failure_if_not_possible | ) |
Retrieve the cached OID constants for the current database.
On first call (or after a cache miss) this function looks up the OIDs of all ProvSQL-specific types, functions, and operators in the system catalogs and stores them in a per-database cache. Subsequent calls return the cached values without touching the catalogs.
| failure_if_not_possible | If true, call provsql_error when the ProvSQL schema cannot be found (e.g. the extension is not installed in the current database). If false, return a constants_t with ok==false instead of aborting. |
constants_t whose ok field is true on success. Definition at line 425 of file provsql_utils.c.


|
extern |
Names of gate types.
Definition at line 38 of file provsql_utils.c.
|
extern |
|
extern |