19#ifndef PROVSQL_UTILS_H
20#define PROVSQL_UTILS_H
26#include "utils/uuid.h"
28#if PG_VERSION_NUM < 100000
41#include "postgres_ext.h"
42#include "nodes/pg_list.h"
Uniform error-reporting macros for ProvSQL.
bool provsql_where_provenance
Global variable that indicates if where-provenance support has been activated through the provsql....
int provsql_verbose
Global variable that indicates the verbosity level set by the provsql.verbose_level run-time configur...
const char * gate_type_name[]
Names of gate types.
Oid find_equality_operator(Oid ltypeId, Oid rtypeId)
Find the equality operator OID for two given types.
constants_t get_constants(bool failure_if_not_possible)
Retrieve the cached OID constants for the current database.
gate_type
Possible gate type in the provenance circuit.
@ gate_update
Update operation.
@ gate_monus
M-Semiring monus.
@ gate_eq
Equijoin gate (for where provenance)
@ gate_value
Scalar value (for aggregate provenance)
@ gate_delta
δ-semiring operator (see Amsterdamer, Deutch, Tannen, PODS 2011)
@ gate_mulinput
Multivalued input (for Boolean provenance)
@ gate_zero
Semiring zero.
@ gate_agg
Aggregation operator (for aggregate provenance)
@ gate_project
Project gate (for where provenance)
@ gate_invalid
Invalid gate type.
@ gate_times
Semiring times.
@ gate_cmp
Currently unused, meant for comparison of aggregate values.
@ nb_gate_types
Total number of gate types.
@ gate_plus
Semiring plus.
@ gate_semimod
Semimodule scalar multiplication (for aggregate provenance)
@ gate_input
Input (variable) gate of the circuit.
#define UUID_LEN
Number of bytes in a UUID.
bool provsql_interrupted
Global variable that becomes true if this particular backend received an interrupt signal.
Structure to store the value of various constants.
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_PROVENANCE
OID of the provenance FUNCTION.
Oid OID_FUNCTION_AGG_TOKEN_UUID
OID of the agg_token_uuid FUNCTION.
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_GATE_TYPE
OID of the provenance_gate TYPE.
Oid OID_FUNCTION_PROVENANCE_PROJECT
OID of the provenance_project FUNCTION.
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.
bool ok
true if constants were loaded
Oid OID_TYPE_INT_ARRAY
OID of the INT[] TYPE.
Oid OID_FUNCTION_PROVENANCE_DELTA
OID of the provenance_delta 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_TYPE_BOOL
OID of the BOOL TYPE.
Oid OID_FUNCTION_NOT_EQUAL_UUID
OID of the = operator on UUIDs FUNCTION.
Oid OID_FUNCTION_GATE_ONE
OID of the provenance_one FUNCTION.
Oid OID_TYPE_UUID_ARRAY
OID of the uuid[] TYPE.
Oid OID_FUNCTION_PROVENANCE_CMP
OID of the provenance_cmp 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.
unsigned char data[UUID_LEN]
Raw 16-byte UUID storage.