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"
98 bool was_unknown =
false;
101 if ((arg1 == UNKNOWNOID) && (arg2 != InvalidOid))
106 else if ((arg2 == UNKNOWNOID) && (arg1 != InvalidOid))
112 result = OpernameGetOprid(opname, arg1, arg2);
113 if (OidIsValid(result))
119 Oid basetype = getBaseType(arg1);
121 if (basetype != arg1)
123 result = OpernameGetOprid(opname, basetype, basetype);
124 if (OidIsValid(result))
137 List *
const equals=list_make1(makeString(
"="));
139 FuncCandidateList clist;
140 Oid inputOids[2] = {ltypeId,rtypeId};
145 if(result!=InvalidOid)
150 ncandidates = func_match_argtypes(2, inputOids,
153 if (ncandidates == 0)
155 else if (ncandidates == 1)
158 clist = func_select_candidate(2, inputOids, clist);
178 list_make1(makeString(s)),
202 list_make2(makeString(
"provsql"),makeString(s)),
226 return LookupFuncName(list_make2(makeString(
"provsql"), makeString(s)),
227 nargs, argtypes,
true );
245 const char *operatorName,
246 Oid operatorNamespace,
249 Oid *operatorObjectId,
250 Oid *functionObjectId)
255 tup = SearchSysCache4(OPERNAMENSP,
256 PointerGetDatum(operatorName),
257 ObjectIdGetDatum(leftObjectId),
258 ObjectIdGetDatum(rightObjectId),
259 ObjectIdGetDatum(operatorNamespace));
260 if (HeapTupleIsValid(tup))
262 Form_pg_operator oprform = (Form_pg_operator) GETSTRUCT(tup);
263#if PG_VERSION_NUM >= 120000
264 *operatorObjectId = oprform->oid;
266 *operatorObjectId = HeapTupleGetOid(tup);
268 *functionObjectId = oprform->oprcode;
269 defined = RegProcedureIsValid(oprform->oprcode);
270 ReleaseSysCache(tup);
278 *operatorObjectId = 0;
279 *functionObjectId = 0;
296 tup = SearchSysCache2(ENUMTYPOIDNAME,
297 ObjectIdGetDatum(enumtypoid),
298 CStringGetDatum(label));
299 if (!HeapTupleIsValid(tup))
302#if PG_VERSION_NUM >= 120000
303 ret = ((Form_pg_enum) GETSTRUCT(tup))->oid;
305 ret = HeapTupleGetOid(tup);
308 ReleaseSysCache(tup);
330 constants.
ok =
false;
333 #define CheckOid(o) if(constants.o==InvalidOid) { \
334 if(failure_if_not_possible) \
335 provsql_error("Could not initialize provsql constants"); \
347#
if PG_VERSION_NUM >= 120000
350 CStringGetDatum(
"provenance_gate"),
357#
if PG_VERSION_NUM >= 120000
360 CStringGetDatum(
"agg_token"),
386#if PG_VERSION_NUM >= 140000
403 CheckOid(OID_FUNCTION_PROVENANCE_PLUS);
406 CheckOid(OID_FUNCTION_PROVENANCE_TIMES);
409 CheckOid(OID_FUNCTION_PROVENANCE_MONUS);
412 CheckOid(OID_FUNCTION_PROVENANCE_PROJECT);
415 CheckOid(OID_FUNCTION_PROVENANCE_EQ);
421 CheckOid(OID_FUNCTION_PROVENANCE_DELTA);
424 CheckOid(OID_FUNCTION_PROVENANCE_AGGREGATE);
427 CheckOid(OID_FUNCTION_PROVENANCE_SEMIMOD);
436 CheckOid(OID_FUNCTION_PROVENANCE_CMP);
439 CheckOid(OID_FUNCTION_AGG_TOKEN_UUID);
447 CheckOid(OID_FUNCTION_GET_CHILDREN);
456 Oid argtypes[1] = { ANYARRAYOID };
457 constants.
OID_UNNEST = LookupFuncName(list_make1(makeString(
"unnest")),
472#
if PG_VERSION_NUM >= 120000
475 CStringGetDatum(
"random_variable"),
680 Oid uuid_sig[3] = { constants.
OID_TYPE_UUID, TEXTOID, TEXTOID };
681 Oid bool_sig[3] = { BOOLOID, TEXTOID, TEXTOID };
708 CheckOid(OID_OPERATOR_NOT_EQUAL_UUID);
709 CheckOid(OID_FUNCTION_NOT_EQUAL_UUID);
712 #define GET_GATE_TYPE_OID(x) { \
713 constants.GATE_TYPE_TO_OID[gate_ ## x] = get_enum_oid( \
714 constants.OID_TYPE_GATE_TYPE, \
716 if(constants.GATE_TYPE_TO_OID[gate_ ## x]==InvalidOid) \
717 provsql_error("Could not initialize provsql gate type " #x); }
733 #define GET_GATE_TYPE_OID_OPTIONAL(x) { \
734 constants.GATE_TYPE_TO_OID[gate_ ## x] = get_enum_oid( \
735 constants.OID_TYPE_GATE_TYPE, \
786 unsigned mid=(start+end)/2;
810 for(
unsigned i=0; i<start; ++i)
813 constants_cache2[start].
database=MyDatabaseId;
814 constants_cache2[start].
constants=constants;
856 while(end >= start) {
857 int mid = (start + end) / 2;
865 if(insert_at) *insert_at = start;
876 for(
int i = 0; i < pos; ++i)
878 new_buf[pos].
relid = relid;
879 new_buf[pos].
valid =
true;
880 new_buf[pos].
present = present;
884 memcpy(new_buf[pos].block_key, info->
block_key,
902 if(relid == InvalidOid) {
991 while(end >= start) {
992 int mid = (start + end) / 2;
1000 if(insert_at) *insert_at = start;
1005 uint16 ancestor_n,
const Oid *ancestors)
1009 for(
int i = 0; i < pos; ++i)
1011 new_buf[pos].
relid = relid;
1012 new_buf[pos].
valid =
true;
1013 new_buf[pos].
present = present;
1016 memcpy(new_buf[pos].ancestors, ancestors,
1017 ancestor_n *
sizeof(Oid));
1030 if(relid == InvalidOid) {
1075 memcpy(e->
ancestors, ancestors, n *
sizeof(Oid));
1082 *ancestor_n_out = n;
1083 memcpy(ancestors_out, ancestors, n *
sizeof(Oid));
1122 while(end >= start) {
1123 int mid = (start + end) / 2;
1131 if(insert_at) *insert_at = start;
1140 for(
int i = 0; i < pos; ++i)
1142 new_buf[pos].
relid = relid;
1143 new_buf[pos].
valid =
true;
1147 memcpy(new_buf[pos].keys, keys->
keys,
1160 if(relid == InvalidOid) {
1199 conrel =
table_open(ConstraintRelationId, AccessShareLock);
1201 Anum_pg_constraint_conrelid,
1202 BTEqualStrategyNumber, F_OIDEQ,
1203 ObjectIdGetDatum(relid));
1204 scan = systable_beginscan(conrel,
1205#
if PG_VERSION_NUM >= 110000
1206 ConstraintRelidTypidNameIndexId,
1208 ConstraintRelidIndexId,
1210 true, NULL, 1, &skey);
1212 while(HeapTupleIsValid(htup = systable_getnext(scan))) {
1213 Form_pg_constraint con = (Form_pg_constraint) GETSTRUCT(htup);
1219 bool ok_not_null =
true;
1221 if(con->contype != CONSTRAINT_PRIMARY && con->contype != CONSTRAINT_UNIQUE)
1226 indexrelid = con->conindid;
1227 if(!OidIsValid(indexrelid))
1229 idxtup = SearchSysCache1(INDEXRELID, ObjectIdGetDatum(indexrelid));
1230 if(!HeapTupleIsValid(idxtup))
1232 idx = (Form_pg_index) GETSTRUCT(idxtup);
1235 ReleaseSysCache(idxtup);
1240 key->
col_n = (uint16) idx->indnatts;
1241 for(k = 0; k < idx->indnatts; ++k) {
1242 AttrNumber attno = idx->indkey.values[k];
1243 key->
cols[k] = attno;
1245 if(con->contype == CONSTRAINT_UNIQUE) {
1247 SearchSysCache2(ATTNUM,
1248 ObjectIdGetDatum(relid),
1249 Int16GetDatum(attno));
1250 if(!HeapTupleIsValid(atttup)) {
1251 ok_not_null =
false;
1254 Form_pg_attribute attform = (Form_pg_attribute) GETSTRUCT(atttup);
1255 if(!attform->attnotnull)
1256 ok_not_null =
false;
1257 ReleaseSysCache(atttup);
1263 ReleaseSysCache(idxtup);
1271 systable_endscan(scan);
1274 return out->
key_n > 0;
1330 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().
bool provsql_fetch_table_info(Oid relid, ProvenanceTableInfo *out)
C-callable IPC fetch for per-table provenance metadata.
bool provsql_fetch_ancestry(Oid relid, uint16 *ancestor_n_out, Oid *ancestors_out)
C-callable IPC fetch for the ancestor half of a per-table metadata record.
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.
#define table_close(r, l)
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...
#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_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_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_GATE_ZERO
OID of the provenance_zero FUNCTION.
Oid OID_SCHEMA_PROVSQL
OID of the provsql SCHEMA.
Oid OID_TYPE_RANDOM_VARIABLE_ARRAY
OID of the random_variable[] TYPE.
Oid OID_AGG_PRODUCT_RV
provsql.product(random_variable)
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_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_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_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_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_PROVENANCE_DELTA
OID of the provenance_delta FUNCTION.
Oid OID_FUNCTION_ASSUME_BOOLEAN
OID of provsql.assume_boolean(uuid)->uuid.
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_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_GATE_ONE
OID of the provenance_one FUNCTION.
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_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_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_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_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.
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