22#include "access/htup_details.h"
23#if PG_VERSION_NUM >= 120000
24#include "access/table.h"
26#include "access/heapam.h"
27#define table_open(r, l) heap_open((r), (l))
28#define table_close(r, l) heap_close((r), (l))
30#include "access/genam.h"
32#include "catalog/indexing.h"
33#include "catalog/namespace.h"
34#include "catalog/pg_attribute.h"
35#include "catalog/pg_constraint.h"
36#include "catalog/pg_index.h"
37#include "catalog/pg_type.h"
38#include "catalog/pg_enum.h"
39#include "catalog/pg_namespace.h"
40#include "catalog/pg_operator.h"
41#include "catalog/pg_type.h"
44#include "nodes/value.h"
45#include "parser/parse_func.h"
46#include "utils/fmgroids.h"
47#include "utils/syscache.h"
48#include "utils/lsyscache.h"
49#include "utils/inval.h"
101 bool was_unknown =
false;
104 if ((arg1 == UNKNOWNOID) && (arg2 != InvalidOid))
109 else if ((arg2 == UNKNOWNOID) && (arg1 != InvalidOid))
115 result = OpernameGetOprid(opname, arg1, arg2);
116 if (OidIsValid(result))
122 Oid basetype = getBaseType(arg1);
124 if (basetype != arg1)
126 result = OpernameGetOprid(opname, basetype, basetype);
127 if (OidIsValid(result))
140 List *
const equals=list_make1(makeString(
"="));
142 FuncCandidateList clist;
143 Oid inputOids[2] = {ltypeId,rtypeId};
148 if(result!=InvalidOid)
153 ncandidates = func_match_argtypes(2, inputOids,
156 if (ncandidates == 0)
158 else if (ncandidates == 1)
161 clist = func_select_candidate(2, inputOids, clist);
181 list_make1(makeString(s)),
205 list_make2(makeString(
"provsql"),makeString(s)),
229 return LookupFuncName(list_make2(makeString(
"provsql"), makeString(s)),
230 nargs, argtypes,
true );
248 const char *operatorName,
249 Oid operatorNamespace,
252 Oid *operatorObjectId,
253 Oid *functionObjectId)
258 tup = SearchSysCache4(OPERNAMENSP,
259 PointerGetDatum(operatorName),
260 ObjectIdGetDatum(leftObjectId),
261 ObjectIdGetDatum(rightObjectId),
262 ObjectIdGetDatum(operatorNamespace));
263 if (HeapTupleIsValid(tup))
265 Form_pg_operator oprform = (Form_pg_operator) GETSTRUCT(tup);
266#if PG_VERSION_NUM >= 120000
267 *operatorObjectId = oprform->oid;
269 *operatorObjectId = HeapTupleGetOid(tup);
271 *functionObjectId = oprform->oprcode;
272 defined = RegProcedureIsValid(oprform->oprcode);
273 ReleaseSysCache(tup);
281 *operatorObjectId = 0;
282 *functionObjectId = 0;
299 tup = SearchSysCache2(ENUMTYPOIDNAME,
300 ObjectIdGetDatum(enumtypoid),
301 CStringGetDatum(label));
302 if (!HeapTupleIsValid(tup))
305#if PG_VERSION_NUM >= 120000
306 ret = ((Form_pg_enum) GETSTRUCT(tup))->oid;
308 ret = HeapTupleGetOid(tup);
311 ReleaseSysCache(tup);
333 constants.
ok =
false;
336 #define CheckOid(o) if(constants.o==InvalidOid) { \
337 if(failure_if_not_possible) \
338 provsql_error("Could not initialize provsql constants"); \
350#
if PG_VERSION_NUM >= 120000
353 CStringGetDatum(
"provenance_gate"),
360#
if PG_VERSION_NUM >= 120000
363 CStringGetDatum(
"agg_token"),
389#if PG_VERSION_NUM >= 140000
406 CheckOid(OID_FUNCTION_PROVENANCE_PLUS);
409 CheckOid(OID_FUNCTION_PROVENANCE_TIMES);
412 CheckOid(OID_FUNCTION_PROVENANCE_MONUS);
415 CheckOid(OID_FUNCTION_PROVENANCE_PROJECT);
418 CheckOid(OID_FUNCTION_PROVENANCE_EQ);
424 CheckOid(OID_FUNCTION_PROVENANCE_DELTA);
427 CheckOid(OID_FUNCTION_PROVENANCE_AGGREGATE);
430 CheckOid(OID_FUNCTION_PROVENANCE_SEMIMOD);
479 CheckOid(OID_FUNCTION_PROVENANCE_CMP);
482 CheckOid(OID_FUNCTION_AGG_TOKEN_UUID);
490 CheckOid(OID_FUNCTION_GET_CHILDREN);
499 Oid argtypes[1] = { ANYARRAYOID };
500 constants.
OID_UNNEST = LookupFuncName(list_make1(makeString(
"unnest")),
515#
if PG_VERSION_NUM >= 120000
518 CStringGetDatum(
"random_variable"),
727 Oid uuid_sig[3] = { constants.
OID_TYPE_UUID, TEXTOID, TEXTOID };
728 Oid bool_sig[3] = { BOOLOID, TEXTOID, TEXTOID };
755 CheckOid(OID_OPERATOR_NOT_EQUAL_UUID);
756 CheckOid(OID_FUNCTION_NOT_EQUAL_UUID);
759 #define GET_GATE_TYPE_OID(x) { \
760 constants.GATE_TYPE_TO_OID[gate_ ## x] = get_enum_oid( \
761 constants.OID_TYPE_GATE_TYPE, \
763 if(constants.GATE_TYPE_TO_OID[gate_ ## x]==InvalidOid) \
764 provsql_error("Could not initialize provsql gate type " #x); }
780 #define GET_GATE_TYPE_OID_OPTIONAL(x) { \
781 constants.GATE_TYPE_TO_OID[gate_ ## x] = get_enum_oid( \
782 constants.OID_TYPE_GATE_TYPE, \
836 unsigned mid=(start+end)/2;
860 for(
unsigned i=0; i<start; ++i)
863 constants_cache2[start].
database=MyDatabaseId;
864 constants_cache2[start].
constants=constants;
906 while(end >= start) {
907 int mid = (start + end) / 2;
915 if(insert_at) *insert_at = start;
926 for(
int i = 0; i < pos; ++i)
928 new_buf[pos].
relid = relid;
929 new_buf[pos].
valid =
true;
930 new_buf[pos].
present = present;
934 memcpy(new_buf[pos].block_key, info->
block_key,
952 if(relid == InvalidOid) {
1041 while(end >= start) {
1042 int mid = (start + end) / 2;
1050 if(insert_at) *insert_at = start;
1055 uint16 ancestor_n,
const Oid *ancestors)
1059 for(
int i = 0; i < pos; ++i)
1061 new_buf[pos].
relid = relid;
1062 new_buf[pos].
valid =
true;
1063 new_buf[pos].
present = present;
1066 memcpy(new_buf[pos].ancestors, ancestors,
1067 ancestor_n *
sizeof(Oid));
1080 if(relid == InvalidOid) {
1125 memcpy(e->
ancestors, ancestors, n *
sizeof(Oid));
1132 *ancestor_n_out = n;
1133 memcpy(ancestors_out, ancestors, n *
sizeof(Oid));
1172 while(end >= start) {
1173 int mid = (start + end) / 2;
1181 if(insert_at) *insert_at = start;
1190 for(
int i = 0; i < pos; ++i)
1192 new_buf[pos].
relid = relid;
1193 new_buf[pos].
valid =
true;
1197 memcpy(new_buf[pos].keys, keys->
keys,
1210 if(relid == InvalidOid) {
1249 conrel = table_open(ConstraintRelationId, AccessShareLock);
1251 Anum_pg_constraint_conrelid,
1252 BTEqualStrategyNumber, F_OIDEQ,
1253 ObjectIdGetDatum(relid));
1254 scan = systable_beginscan(conrel,
1255 ConstraintRelidTypidNameIndexId,
1256 true, NULL, 1, &skey);
1258 while(HeapTupleIsValid(htup = systable_getnext(scan))) {
1259 Form_pg_constraint con = (Form_pg_constraint) GETSTRUCT(htup);
1265 bool ok_not_null =
true;
1267 if(con->contype != CONSTRAINT_PRIMARY && con->contype != CONSTRAINT_UNIQUE)
1272 indexrelid = con->conindid;
1273 if(!OidIsValid(indexrelid))
1275 idxtup = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexrelid));
1276 if(!HeapTupleIsValid(idxtup))
1278 idx = (Form_pg_index) GETSTRUCT(idxtup);
1281 ReleaseSysCache(idxtup);
1286 key->
col_n = (uint16) idx->indnatts;
1287 for(k = 0; k < idx->indnatts; ++k) {
1288 AttrNumber attno = idx->indkey.values[k];
1289 key->
cols[k] = attno;
1291 if(con->contype == CONSTRAINT_UNIQUE) {
1293 SearchSysCache2(ATTNUM,
1294 ObjectIdGetDatum(relid),
1295 Int16GetDatum(attno));
1296 if(!HeapTupleIsValid(atttup)) {
1297 ok_not_null =
false;
1300 Form_pg_attribute attform = (Form_pg_attribute) GETSTRUCT(atttup);
1301 if(!attform->attnotnull)
1302 ok_not_null =
false;
1303 ReleaseSysCache(atttup);
1309 ReleaseSysCache(idxtup);
1317 systable_endscan(scan);
1318 table_close(conrel, AccessShareLock);
1320 return out->
key_n > 0;
1376 unsigned mid=(start+end)/2;
#define PROVSQL_TABLE_INFO_MAX_BLOCK_KEY
Cap on the number of block-key columns recorded per relation.
#define PROVSQL_TABLE_INFO_MAX_ANCESTORS
Cap on the number of base ancestors recorded per relation.
PostgreSQL cross-version compatibility shims for ProvSQL.
static FuncCandidateList OpernameGetCandidatesCompat(List *names, char oprkind, bool missing_schema_ok)
Version-agnostic wrapper around OpernameGetCandidates().
static FuncCandidateList FuncnameGetCandidatesCompat(List *names, int nargs, List *argnames, bool expand_variadic, bool expand_defaults, bool include_out_arguments, bool missing_ok)
Version-agnostic wrapper around FuncnameGetCandidates().
static bool key_cache_callback_registered
static unsigned table_info_cache_len
static bool table_info_callback_registered
const char * gate_type_name[]
Names of gate types.
static Oid get_enum_oid(Oid enumtypoid, const char *label)
Return the OID of a specific enum label within an enum type.
static int key_cache_find(Oid relid, int *insert_at)
static void invalidate_ancestry_cache_callback(Datum arg, Oid relid)
static void OperatorGet(const char *operatorName, Oid operatorNamespace, Oid leftObjectId, Oid rightObjectId, Oid *operatorObjectId, Oid *functionObjectId)
Retrieve operator and function OIDs for a named operator.
Datum reset_constants_cache(PG_FUNCTION_ARGS)
SQL function to invalidate the OID constants cache.
Oid find_equality_operator(Oid ltypeId, Oid rtypeId)
Find the equality operator OID for two given types.
static void ancestry_cache_insert(int pos, Oid relid, bool present, uint16 ancestor_n, const Oid *ancestors)
#define GET_GATE_TYPE_OID_OPTIONAL(x)
bool provsql_lookup_ancestry(Oid relid, uint16 *ancestor_n_out, Oid *ancestors_out)
Look up the base-ancestor set of a tracked relation.
static Oid get_provsql_func_oid(char *s)
Return the OID of a provsql-schema function named s.
static database_constants_t * constants_cache
Per-database OID constants cache (sorted by database OID).
static void invalidate_table_info_cache_callback(Datum arg, Oid relid)
Relcache callback: PostgreSQL fires this whenever a relation's relcache entry is invalidated (locally...
bool provsql_lookup_table_info(Oid relid, ProvenanceTableInfo *out)
Look up per-table provenance metadata with a backend-local cache.
static Oid get_provsql_func_oid_args(char *s, int nargs, Oid *argtypes)
Return the OID of a provsql-schema function named s with a specific argument-type signature.
static bool ancestry_callback_registered
static void table_info_cache_insert(int pos, Oid relid, bool present, const ProvenanceTableInfo *info)
Insert a fresh entry at pos (which must be the value returned by the most recent table_info_cache_fin...
static table_info_cache_entry * table_info_cache
Sorted by relid.
constants_t get_constants(bool failure_if_not_possible)
Retrieve the cached OID constants for the current database.
static unsigned constants_cache_len
Number of valid entries in constants_cache.
static int table_info_cache_find(Oid relid, int *insert_at)
Find relid in the cache.
static int ancestry_cache_find(Oid relid, int *insert_at)
static void invalidate_key_cache_callback(Datum arg, Oid relid)
bool provsql_lookup_relation_keys(Oid relid, ProvenanceRelationKeys *out)
Look up the PRIMARY-KEY and NOT-NULL-UNIQUE keys of a relation with a backend-local cache.
static unsigned ancestry_cache_len
static bool fetch_relation_keys(Oid relid, ProvenanceRelationKeys *out)
Read the PRIMARY-KEY and NOT-NULL-UNIQUE keys of relid from the system catalogs.
static Oid get_func_oid(char *s)
Return the OID of a globally qualified function named s.
static unsigned key_cache_len
static Oid binary_oper_exact(List *opname, Oid arg1, Oid arg2)
Look up an exactly matching binary operator OID.
#define GET_GATE_TYPE_OID(x)
static void key_cache_insert(int pos, Oid relid, const ProvenanceRelationKeys *keys)
static key_cache_entry * key_cache
static constants_t initialize_constants(bool failure_if_not_possible)
Query the system catalogs to populate a fresh constants_t.
static ancestry_cache_entry * ancestry_cache
Core types, constants, and utilities shared across ProvSQL.
#define PROVSQL_KEY_CACHE_MAX_KEY_COLS
@ gate_assumed
Structural marker over a single child whose sub-circuit was computed under a Boolean-provenance assum...
bool provsql_fetch_table_info(Oid relid, ProvenanceTableInfo *out)
Raw IPC fetch (no cache).
bool provsql_fetch_ancestry(Oid relid, uint16 *ancestor_n_out, Oid *ancestors_out)
Raw IPC fetch for the ancestry half (no cache).
#define PROVSQL_KEY_CACHE_MAX_KEYS
Upper bounds for the relation-key cache.
One PRIMARY-KEY or NOT-NULL-UNIQUE key on a relation.
AttrNumber cols[PROVSQL_KEY_CACHE_MAX_KEY_COLS]
Per-relation set of PRIMARY-KEY and NOT-NULL-UNIQUE keys.
ProvenanceRelationKey keys[PROVSQL_KEY_CACHE_MAX_KEYS]
Per-relation metadata for the safe-query optimisation.
Oid relid
pg_class OID of the relation (primary key)
AttrNumber block_key[PROVSQL_TABLE_INFO_MAX_BLOCK_KEY]
Block-key column numbers.
uint16_t block_key_n
Number of valid entries in block_key.
uint8_t kind
One of provsql_table_kind.
uint16 ancestor_n
when present: count
Oid ancestors[PROVSQL_TABLE_INFO_MAX_ANCESTORS]
when present: ancestor OIDs
Oid relid
pg_class OID (sort key)
bool present
when valid: did the worker return any ancestors?
bool valid
false => refresh on next access
Structure to store the value of various constants.
Oid OID_FUNCTION_REGULAR_INDICATOR
OID of provsql.regular_indicator(boolean): the deterministic gate_one/gate_zero indicator the planner...
Oid OID_FUNCTION_PROVENANCE_EQ
OID of the provenance_eq FUNCTION.
Oid OID_FUNCTION_PROVENANCE_AGGREGATE
OID of the provenance_aggregate FUNCTION.
Oid OID_FUNCTION_WINDOW_DISTINCT_TOKENS
OID of window_distinct_tokens, used for dense_rank(); InvalidOid on a schema that predates it.
Oid OID_FUNCTION_PROVENANCE_SEMIMOD
OID of the provenance_semimod FUNCTION.
Oid OID_FUNCTION_RV_DIV
OID of random_variable_div(rv, rv) -> rv: builds the avg num/denom division gate.
Oid OID_AGG_AVG_RV
provsql.avg(random_variable)
Oid OID_AGG_RV_CORR_IMPL
provsql.rv_corr_impl(ind rv, x rv, y rv)
Oid OID_AGG_RV_SUM_OR_NULL
provsql.rv_sum_or_null(random_variable): the avg-numerator sum, NULL on an empty group (so avg is NUL...
Oid OID_AGG_SUM_RV
OIDs of the RV-returning aggregates, keyed for the per-aggregate identity dispatch in make_rv_aggrega...
Oid OID_FUNCTION_CHOOSE
OID of the choose(anyelement) aggregate (keeps the first non-NULL value); used to decorrelate scalar ...
Oid OID_AGG_RV_STDDEV_SAMP_IMPL
provsql.rv_stddev_samp_impl(ind rv, x rv)
Oid OID_AGG_STDDEV_SAMP_RV
provsql.stddev_samp(rv)
Oid OID_FUNCTION_ANNOTATE
OID of provsql.annotate(uuid,text)->uuid.
Oid OID_FUNCTION_PROVENANCE
OID of the provenance FUNCTION.
Oid OID_FUNCTION_AGG_TOKEN_PLAIN_TEXT
OID of agg_token_plain_text(), the sort key of an ORDER BY on an aggregate result; InvalidOid on a sc...
Oid OID_FUNCTION_RV_LEAST
provsql.least(VARIADIC random_variable[])
Oid OID_FUNCTION_RV_CASE
OID of provsql.rv_case(uuid[])->random_variable.
Oid OID_FUNCTION_INVERSION_FREE_KEY
OID of provsql.inversion_free_key(text,text,int)->text.
Oid OID_FUNCTION_AGG_VALUE_GATE
agg_value_gate(numeric) -> uuid
Oid OID_FUNCTION_AGG_TOKEN_UUID
OID of the agg_token_uuid FUNCTION.
Oid OID_AGG_STDDEV_POP_RV
provsql.stddev_pop(rv)
Oid OID_FUNCTION_RV_AGGREGATE_SEMIMOD
OID of rv_aggregate_semimod(uuid, rv) -> rv: wraps a per-row argument as mixture(prov,...
Oid OID_TYPE_VARCHAR
OID of the VARCHAR TYPE.
Oid OID_FUNCTION_ORDER_CHECKED
OID of order_checked, which warns where that check fails; InvalidOid on a schema that predates it.
Oid OID_FUNCTION_GATE_ZERO
OID of the provenance_zero FUNCTION.
Oid OID_SCHEMA_PROVSQL
OID of the provsql SCHEMA.
Oid OID_FUNCTION_AGG_TOKEN_FROZEN_VALUE
OID of agg_token_frozen_value(), the value of an aggregate result that ProvSQL casts to a plain value...
Oid OID_TYPE_RANDOM_VARIABLE_ARRAY
OID of the random_variable[] TYPE.
Oid OID_AGG_PRODUCT_RV
provsql.product(random_variable)
Oid OID_FUNCTION_AGG_GUARD_HOLDS
OID of agg_guard_holds(), the truth of a comparison of aggregate results in the database as it is,...
Oid OID_FUNCTION_AGG_TOKEN_EXPLODE_CHILDREN
OID of agg_token_explode_children(), the children of the gate of a choose() result exploded into rows...
Oid OID_FUNCTION_COND
OID of provsql.cond(uuid,uuid)->uuid.
Oid OID_TYPE_GATE_TYPE
OID of the provenance_gate TYPE.
Oid OID_FUNCTION_PROVENANCE_PROJECT
OID of the provenance_project FUNCTION.
Oid OID_FUNCTION_PROVENANCE_CONTRIBUTIONS_CAT
OID of the provenance_contributions_cat aggregate, which collects them; InvalidOid on a schema that p...
Oid OID_FUNCTION_RV_AGGREGATE_INDICATOR
OID of rv_aggregate_indicator(uuid) -> rv: the avg denominator wrap mixture(prov, 1,...
Oid OID_FUNCTION_GET_CHILDREN
OID of the get_children FUNCTION.
Oid OID_FUNCTION_ROW_NUMBER_AS_RANK
OID of row_number_as_rank, which row_number() over tracked relations is rewritten into; InvalidOid on...
Oid OID_FUNCTION_RV_AGGREGATE_SEMIMOD_ID
OID of the 3-arg rv_aggregate_semimod(uuid, rv, float8): identity-parameterised wrap mixture(prov,...
Oid OID_UNNEST
OID of the unnest(anyarray) FUNCTION.
Oid OID_FUNCTION_COND_PREDICATE
cond_predicate(uuid,boolean)
Oid OID_AGG_MIN_RV
provsql.min(random_variable)
Oid OID_TYPE_FLOAT
OID of the FLOAT TYPE.
Oid OID_TYPE_AGG_TOKEN
OID of the agg_token TYPE.
Oid OID_FUNCTION_ARRAY_AGG
OID of the array_agg FUNCTION.
Oid OID_FUNCTION_AGG_TOKEN_NULL_EVENT
OID of agg_token_null_event, the IS [NOT] NULL of an aggregate column; InvalidOid on a schema that pr...
Oid OID_TYPE_INT
OID of the INT TYPE.
Oid GATE_TYPE_TO_OID[nb_gate_types]
Array of the OID of each provenance_gate ENUM value.
Oid OID_FUNCTION_PLAIN
OID of the marker plain(), which keeps a LIMIT a truncation of the actual result; InvalidOid on a sch...
Oid OID_FUNCTION_PROVENANCE_PLUS
OID of the provenance_plus FUNCTION.
Oid OID_OPERATOR_NOT_EQUAL_UUID
OID of the <> operator on UUIDs FUNCTION.
Oid OID_TYPE_UUID
OID of the uuid TYPE.
Oid OID_TYPE_TSTZMULTIRANGE
OID of the tstzmultirange TYPE (PG14+, InvalidOid otherwise).
bool ok
true if constants were loaded
Oid OID_TYPE_INT_ARRAY
OID of the INT[] TYPE.
Oid OID_AGG_RV_PERCENTILE_IMPL
provsql.rv_percentile_impl(fraction float8, ind rv, x rv)
Oid OID_FUNCTION_AGG_COUNT_CAN_BE_ZERO
OID of agg_count_can_be_zero; InvalidOid on a schema that predates it.
Oid OID_FUNCTION_PROVENANCE_DELTA
OID of the provenance_delta FUNCTION.
Oid OID_FUNCTION_ASSUME_BOOLEAN
OID of provsql.assume_boolean(uuid)->uuid.
Oid OID_FUNCTION_AGG_POSSIBLE_VALUES
OID of agg_possible_values(), the values an aggregate result takes over the possible worlds,...
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_AGG_COND_PREDICATE
agg_token_cond_predicate(agg_token,boolean)
Oid OID_FUNCTION_GIVEN_PREDICATE
given_predicate(boolean) – prefix whole-tuple
Oid OID_TYPE_BOOL
OID of the BOOL TYPE.
Oid OID_FUNCTION_NOT_EQUAL_UUID
OID of the = operator on UUIDs FUNCTION.
Oid OID_FUNCTION_ARRAY_COLLECT
OID of the array_collect(anynonarray) aggregate (array_agg with {} over no rows); the value of a deco...
Oid OID_FUNCTION_AGG_CASE
OID of agg_case(uuid[]), the agg_token constructor the planner hook lowers an aggregate-carrier CASE ...
Oid OID_AGG_CORR_RV
provsql.corr(rv, rv)
Oid OID_FUNCTION_GIVEN
OID of provsql.given(uuid)->uuid.
Oid OID_FUNCTION_PLAIN_TRUTH
OID of plain_truth(), whether a token holds in the database as it is; InvalidOid on a schema that pre...
Oid OID_FUNCTION_GATE_ONE
OID of the provenance_one FUNCTION.
Oid OID_FUNCTION_PROVENANCE_SEMIMOD_NESTED
OID of provenance_semimod_nested(), the contribution of an aggregate result aggregated by an aggregat...
Oid OID_AGG_COVAR_SAMP_RV
provsql.covar_samp(rv, rv)
Oid OID_TYPE_NUMMULTIRANGE
OID of the nummultirange TYPE (PG14+, InvalidOid otherwise).
Oid OID_FUNCTION_RV_AGGREGATE_INDICATOR_VALUED
OID of rv_aggregate_indicator(uuid, rv) -> rv: NULL when the row's value is NULL (SQL NULL-skip for a...
Oid OID_FUNCTION_PROVENANCE_SEMIMOD_FLAT
OID of provenance_semimod_flat(), the contributions of an aggregate result aggregated again; InvalidO...
Oid OID_FUNCTION_PROBABILITY_EVALUATE
OID of the real provsql.probability_evaluate(uuid,text,text).
Oid OID_FUNCTION_RV_COND
OID of provsql.random_variable_cond(random_variable,uuid).
Oid OID_FUNCTION_NTILE_AS_RANK
OID of ntile_as_rank, the tie check of a tracked ntile(); InvalidOid on a schema that predates it.
Oid OID_FUNCTION_RV_COND_PREDICATE
random_variable_cond_predicate(random_variable,boolean)
Oid OID_TYPE_UUID_ARRAY
OID of the uuid[] TYPE.
Oid OID_FUNCTION_PREDICATE_COND_PREDICATE
predicate_cond_predicate(boolean,boolean) – (A)|(B), both events
Oid OID_AGG_MAX_RV
provsql.max(random_variable)
Oid OID_FUNCTION_AGG_COND
OID of provsql.agg_token_cond(agg_token,uuid): the conditioning constructor for the agg_token carrier...
Oid OID_FUNCTION_PROBABILITY_PREDICATE
OID of the probability(boolean,text,text) placeholder.
Oid OID_FUNCTION_GATE_NULL
OID of gate_null(), the value gate of the NULL value (a NULL branch of a CASE over aggregates).
Oid OID_TYPE_RANDOM_VARIABLE
OID of the random_variable TYPE.
Oid OID_AGG_COVAR_POP_RV
SQL-standard statistic aggregates over random_variable rows and their internal indicator-carrying rew...
Oid OID_FUNCTION_PROVENANCE_CMP
OID of the provenance_cmp FUNCTION.
Oid OID_AGG_PERCENTILE_CONT_RV
provsql.percentile_cont(float8) WITHIN GROUP (ORDER BY rv)
Oid OID_FUNCTION_RV_GREATEST
provsql.greatest(VARIADIC random_variable[])
Oid OID_AGG_RV_COVAR_POP_IMPL
provsql.rv_covar_pop_impl(ind rv, x rv, y rv)
Oid OID_AGG_RV_STDDEV_POP_IMPL
provsql.rv_stddev_pop_impl(ind rv, x rv)
Oid OID_TYPE_INT4MULTIRANGE
OID of the int4multirange TYPE (PG14+, InvalidOid otherwise).
Oid OID_AGG_RV_COVAR_SAMP_IMPL
provsql.rv_covar_samp_impl(ind rv, x rv, y rv)
Oid OID_FUNCTION_PROVENANCE_SEMIMOD_NULLABLE
OID of provenance_semimod_nullable, the variant used for aggregates that see their NULL inputs (array...
Oid OID_FUNCTION_GET_EXTRA
OID of the get_extra FUNCTION.
Oid OID_FUNCTION_RV_CMP[6]
OIDs of the random_variable_{eq,ne,le,lt,ge,gt} comparison procedure functions, indexed by the Compar...
Oid OID_FUNCTION_PROVENANCE_CMP_TIMES
OID of the provenance_cmp_times FUNCTION.
Oid OID_FUNCTION_ORDER_DETERMINED
OID of the order_determined aggregate, the tie check of an order-dependent aggregate; InvalidOid on a...
Structure to store the value of various constants for a specific database.
Oid database
OID of the database these constants belong to.
constants_t constants
Cached OID constants for this database.
ProvenanceRelationKey keys[PROVSQL_KEY_CACHE_MAX_KEYS]
uint8 kind
when present: provsql_table_kind value
Oid relid
pg_class OID (sort key)
uint16 block_key_n
when present: number of block-key columns
AttrNumber block_key[PROVSQL_TABLE_INFO_MAX_BLOCK_KEY]
when present: block-key column numbers
bool present
when valid: was a record found at the worker?
bool valid
false => refresh on next access