![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Structure to store the value of various constants. More...
#include "provsql_utils.h"
Public Attributes | |
| Oid | OID_SCHEMA_PROVSQL |
| OID of the provsql SCHEMA. | |
| Oid | OID_TYPE_GATE_TYPE |
| OID of the provenance_gate TYPE. | |
| Oid | OID_TYPE_AGG_TOKEN |
| OID of the agg_token TYPE. | |
| Oid | OID_TYPE_UUID |
| OID of the uuid TYPE. | |
| Oid | OID_TYPE_UUID_ARRAY |
| OID of the uuid[] TYPE. | |
| Oid | OID_TYPE_BOOL |
| OID of the BOOL TYPE. | |
| Oid | OID_TYPE_INT |
| OID of the INT TYPE. | |
| Oid | OID_TYPE_INT_ARRAY |
| OID of the INT[] TYPE. | |
| Oid | OID_TYPE_FLOAT |
| OID of the FLOAT TYPE. | |
| Oid | OID_TYPE_VARCHAR |
| OID of the VARCHAR TYPE. | |
| Oid | OID_TYPE_TSTZMULTIRANGE |
| OID of the tstzmultirange TYPE (PG14+, InvalidOid otherwise). | |
| Oid | OID_TYPE_NUMMULTIRANGE |
| OID of the nummultirange TYPE (PG14+, InvalidOid otherwise). | |
| Oid | OID_TYPE_INT4MULTIRANGE |
| OID of the int4multirange TYPE (PG14+, InvalidOid otherwise). | |
| Oid | OID_FUNCTION_ARRAY_AGG |
| OID of the array_agg FUNCTION. | |
| Oid | OID_FUNCTION_PROVENANCE_PLUS |
| OID of the provenance_plus FUNCTION. | |
| Oid | OID_FUNCTION_PROVENANCE_TIMES |
| OID of the provenance_times FUNCTION. | |
| Oid | OID_FUNCTION_PROVENANCE_MONUS |
| OID of the provenance_monus FUNCTION. | |
| Oid | OID_FUNCTION_PROVENANCE_PROJECT |
| OID of the provenance_project FUNCTION. | |
| Oid | OID_FUNCTION_PROVENANCE_EQ |
| OID of the provenance_eq FUNCTION. | |
| Oid | OID_FUNCTION_PROVENANCE_CMP |
| OID of the provenance_cmp FUNCTION. | |
| Oid | OID_FUNCTION_PROVENANCE |
| OID of the provenance FUNCTION. | |
| Oid | GATE_TYPE_TO_OID [nb_gate_types] |
| Array of the OID of each provenance_gate ENUM value. | |
| Oid | OID_FUNCTION_PROVENANCE_DELTA |
| OID of the provenance_delta FUNCTION. | |
| Oid | OID_FUNCTION_PROVENANCE_AGGREGATE |
| OID of the provenance_aggregate FUNCTION. | |
| Oid | OID_FUNCTION_PROVENANCE_SEMIMOD |
| OID of the provenance_semimod FUNCTION. | |
| Oid | OID_FUNCTION_GATE_ZERO |
| OID of the provenance_zero FUNCTION. | |
| Oid | OID_FUNCTION_GATE_ONE |
| OID of the provenance_one FUNCTION. | |
| Oid | OID_OPERATOR_NOT_EQUAL_UUID |
| OID of the <> operator on UUIDs FUNCTION. | |
| Oid | OID_FUNCTION_NOT_EQUAL_UUID |
| OID of the = operator on UUIDs FUNCTION. | |
| Oid | OID_FUNCTION_AGG_TOKEN_UUID |
| OID of the agg_token_uuid FUNCTION. | |
| Oid | OID_FUNCTION_GET_CHILDREN |
| OID of the get_children FUNCTION. | |
| Oid | OID_FUNCTION_GET_EXTRA |
| OID of the get_extra FUNCTION. | |
| Oid | OID_UNNEST |
| OID of the unnest(anyarray) FUNCTION. | |
| Oid | OID_TYPE_RANDOM_VARIABLE |
| OID of the random_variable TYPE. | |
| Oid | OID_FUNCTION_RV_AGGREGATE_SEMIMOD |
| OID of rv_aggregate_semimod helper (uuid, rv -> rv) used to wrap each per-row argument of an RV-returning aggregate (sum, avg, ...). | |
| Oid | OID_FUNCTION_CHOOSE |
| OID of the choose(anyelement) aggregate (keeps the first non-NULL value); used to decorrelate scalar subqueries into a LEFT JOIN + GROUP BY. | |
| Oid | OID_FUNCTION_ASSUME_BOOLEAN |
OID of provsql.assume_boolean(uuid)->uuid. | |
| Oid | OID_FUNCTION_ANNOTATE |
OID of provsql.annotate(uuid,text)->uuid. | |
| Oid | OID_FUNCTION_INVERSION_FREE_KEY |
OID of provsql.inversion_free_key(text,text,int)->text. | |
| Oid | OID_FUNCTION_RV_CMP [6] |
OIDs of the random_variable_{eq,ne,le,lt,ge,gt} comparison procedure functions, indexed by the ComparisonOperator enum (EQ=0, NE=1, LE=2, LT=3, GE=4, GT=5; matches the order in src/Aggregation.h). | |
| Oid | OID_FUNCTION_COND |
OID of provsql.cond(uuid,uuid)->uuid. | |
| Oid | OID_FUNCTION_GIVEN |
OID of provsql.given(uuid)->uuid. | |
| Oid | OID_FUNCTION_RV_COND |
OID of provsql.random_variable_cond(random_variable,uuid). | |
| Oid | OID_FUNCTION_AGG_COND |
OID of provsql.agg_token_cond(agg_token,uuid): the conditioning constructor for the agg_token carrier the planner emits when rewriting the "SUM(x) | (predicate)" placeholder. | |
| Oid | OID_FUNCTION_REGULAR_INDICATOR |
OID of provsql.regular_indicator(boolean): the deterministic gate_one/ the planner emits for an ordinary (regular-type) comparison appearing inside a mixed conditioning predicate. | |
| bool | ok |
| true if constants were loaded | |
@c "X | (predicate)" placeholder OIDs (carrier-parametric). | |
Each is a no-op placeholder operator whose right operand is a Boolean combination of random_variable / agg_token comparisons; the planner converts that predicate into a condition gate and emits the matching conditioning constructor.
| |
| Oid | OID_FUNCTION_COND_PREDICATE |
| cond_predicate(uuid,boolean) | |
| Oid | OID_FUNCTION_RV_COND_PREDICATE |
| random_variable_cond_predicate(random_variable,boolean) | |
| Oid | OID_FUNCTION_AGG_COND_PREDICATE |
| agg_token_cond_predicate(agg_token,boolean) | |
| Oid | OID_FUNCTION_GIVEN_PREDICATE |
| given_predicate(boolean) – prefix whole-tuple | |
Structure to store the value of various constants.
This is needed to uniquely identify types, functions, etc., in PostgreSQL through their Object Identifier Types (OIDs).
Definition at line 136 of file provsql_utils.h.
| Oid constants_t::GATE_TYPE_TO_OID[nb_gate_types] |
Array of the OID of each provenance_gate ENUM value.
Definition at line 158 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_AGG_COND |
OID of provsql.agg_token_cond(agg_token,uuid): the conditioning constructor for the agg_token carrier the planner emits when rewriting the "SUM(x) | (predicate)" placeholder.
Definition at line 226 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_AGG_COND_PREDICATE |
agg_token_cond_predicate(agg_token,boolean)
Definition at line 235 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_AGG_TOKEN_UUID |
OID of the agg_token_uuid FUNCTION.
Definition at line 166 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_ANNOTATE |
OID of provsql.annotate(uuid,text)->uuid.
Wraps its child in a fresh transparent gate_annotation whose UUID folds in the extra text, and returns the wrapper's UUID. Used to attach the inversion-free tractability certificate (on the root) and the per-input order keys. InvalidOid on a schema predating the gate (the inversion-free carrier is then disabled).
Definition at line 190 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_ARRAY_AGG |
OID of the array_agg FUNCTION.
Definition at line 150 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_ASSUME_BOOLEAN |
OID of provsql.assume_boolean(uuid)->uuid.
Installed by the 1.5.0--1.6.0 upgrade script. Wraps its child in a fresh gate_assumed and returns the wrapper's UUID. When InvalidOid the safe-query rewriter (and any other Boolean-only rewrite that needs the marker) is effectively disabled even if provsql.boolean_provenance is on: the rewriter refuses to produce unmarked roots on a schema that cannot enforce the semiring-compatibility check.
Definition at line 182 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_CHOOSE |
OID of the choose(anyelement) aggregate (keeps the first non-NULL value); used to decorrelate scalar subqueries into a LEFT JOIN + GROUP BY.
Definition at line 172 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_COND |
OID of provsql.cond(uuid,uuid)->uuid.
Builds the terminal gate_conditioned (value-level conditioning, the binary | operator). The rewriter wraps a row's output provenance in it when a given(...) marker is present. InvalidOid on a schema predating the conditioning feature (the given rewrite is then disabled).
Definition at line 211 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_COND_PREDICATE |
cond_predicate(uuid,boolean)
Definition at line 233 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_GATE_ONE |
OID of the provenance_one FUNCTION.
Definition at line 163 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_GATE_ZERO |
OID of the provenance_zero FUNCTION.
Definition at line 162 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_GET_CHILDREN |
OID of the get_children FUNCTION.
Definition at line 167 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_GET_EXTRA |
OID of the get_extra FUNCTION.
Definition at line 168 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_GIVEN |
OID of provsql.given(uuid)->uuid.
The whole-tuple output-conditioning marker: a consumed select-list term the rewriter strips from the visible projection, conditioning each output row's provenance on the marker's argument. InvalidOid on a schema predating the feature.
Definition at line 218 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_GIVEN_PREDICATE |
given_predicate(boolean) – prefix whole-tuple
Definition at line 236 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_INVERSION_FREE_KEY |
OID of provsql.inversion_free_key(text,text,int)->text.
Builds the K-prefixed per-input order-key string the planner attaches (via annotate) to each certified atom's provenance on the inversion-free path. InvalidOid on a schema predating it (markers are then not attached; the path declines and falls back).
Definition at line 197 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_NOT_EQUAL_UUID |
OID of the = operator on UUIDs FUNCTION.
Definition at line 165 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE |
OID of the provenance FUNCTION.
Definition at line 157 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE_AGGREGATE |
OID of the provenance_aggregate FUNCTION.
Definition at line 160 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE_CMP |
OID of the provenance_cmp FUNCTION.
Definition at line 156 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE_DELTA |
OID of the provenance_delta FUNCTION.
Definition at line 159 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE_EQ |
OID of the provenance_eq FUNCTION.
Definition at line 155 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE_MONUS |
OID of the provenance_monus FUNCTION.
Definition at line 153 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE_PLUS |
OID of the provenance_plus FUNCTION.
Definition at line 151 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE_PROJECT |
OID of the provenance_project FUNCTION.
Definition at line 154 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE_SEMIMOD |
OID of the provenance_semimod FUNCTION.
Definition at line 161 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_PROVENANCE_TIMES |
OID of the provenance_times FUNCTION.
Definition at line 152 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_REGULAR_INDICATOR |
OID of provsql.regular_indicator(boolean): the deterministic gate_one/ the planner emits for an ordinary (regular-type) comparison appearing inside a mixed conditioning predicate. gate_zero indicator
Definition at line 242 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_RV_AGGREGATE_SEMIMOD |
OID of rv_aggregate_semimod helper (uuid, rv -> rv) used to wrap each per-row argument of an RV-returning aggregate (sum, avg, ...).
Definition at line 171 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_RV_CMP[6] |
OIDs of the random_variable_{eq,ne,le,lt,ge,gt} comparison procedure functions, indexed by the ComparisonOperator enum (EQ=0, NE=1, LE=2, LT=3, GE=4, GT=5; matches the order in src/Aggregation.h).
Used by the planner hook to detect RV-comparison OpExpr nodes in WHERE clauses.
Definition at line 203 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_RV_COND |
OID of provsql.random_variable_cond(random_variable,uuid).
The real conditioning constructor the planner emits when rewriting the "X | (predicate)" placeholder. InvalidOid disables the rewrite.
Definition at line 222 of file provsql_utils.h.
| Oid constants_t::OID_FUNCTION_RV_COND_PREDICATE |
random_variable_cond_predicate(random_variable,boolean)
Definition at line 234 of file provsql_utils.h.
| Oid constants_t::OID_OPERATOR_NOT_EQUAL_UUID |
OID of the <> operator on UUIDs FUNCTION.
Definition at line 164 of file provsql_utils.h.
| Oid constants_t::OID_SCHEMA_PROVSQL |
OID of the provsql SCHEMA.
Definition at line 137 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_AGG_TOKEN |
OID of the agg_token TYPE.
Definition at line 139 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_BOOL |
OID of the BOOL TYPE.
Definition at line 142 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_FLOAT |
OID of the FLOAT TYPE.
Definition at line 145 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_GATE_TYPE |
OID of the provenance_gate TYPE.
Definition at line 138 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_INT |
OID of the INT TYPE.
Definition at line 143 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_INT4MULTIRANGE |
OID of the int4multirange TYPE (PG14+, InvalidOid otherwise).
Definition at line 149 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_INT_ARRAY |
OID of the INT[] TYPE.
Definition at line 144 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_NUMMULTIRANGE |
OID of the nummultirange TYPE (PG14+, InvalidOid otherwise).
Definition at line 148 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_RANDOM_VARIABLE |
OID of the random_variable TYPE.
Definition at line 170 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_TSTZMULTIRANGE |
OID of the tstzmultirange TYPE (PG14+, InvalidOid otherwise).
Definition at line 147 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_UUID |
OID of the uuid TYPE.
Definition at line 140 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_UUID_ARRAY |
OID of the uuid[] TYPE.
Definition at line 141 of file provsql_utils.h.
| Oid constants_t::OID_TYPE_VARCHAR |
OID of the VARCHAR TYPE.
Definition at line 146 of file provsql_utils.h.
| Oid constants_t::OID_UNNEST |
OID of the unnest(anyarray) FUNCTION.
Definition at line 169 of file provsql_utils.h.
| bool constants_t::ok |
true if constants were loaded
Definition at line 243 of file provsql_utils.h.