![]() |
ProvSQL SQL API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Functions for enabling, disabling, and configuring provenance tracking on user tables. More...
Functions | |
| TRIGGER | provsql.add_gate_trigger () |
| Trigger function that creates an input gate for each newly inserted row. | |
| TRIGGER | provsql.delete_statement_trigger () |
| Trigger function for DELETE statement provenance tracking. | |
| VOID | provsql.add_provenance (REGCLASS _tbl) |
| Enable provenance tracking on an existing table. | |
| VOID | provsql.remove_provenance (REGCLASS _tbl) |
| Remove provenance tracking from a table. | |
| VOID | provsql.repair_key (REGCLASS _tbl, TEXT key_att) |
| Set up provenance for a table with duplicate key values. | |
| VOID | provsql.create_provenance_mapping (TEXT newtbl, REGCLASS oldtbl, TEXT att, BOOL preserve_case='f') |
| Create a provenance mapping table from an attribute. | |
Functions for enabling, disabling, and configuring provenance tracking on user tables.
| TRIGGER provsql.add_gate_trigger | ( | ) |
Trigger function that creates an input gate for each newly inserted row.
| VOID provsql.add_provenance | ( | REGCLASS | _tbl | ) |
Enable provenance tracking on an existing table.
Adds a provsql UUID column to the table, creates input gates for all existing rows, and installs a trigger to track future inserts.
| _tbl | the table to add provenance tracking to |
| VOID provsql.create_provenance_mapping | ( | TEXT | newtbl, |
| REGCLASS | oldtbl, | ||
| TEXT | att, | ||
| BOOL | preserve_case = 'f' |
||
| ) |
Create a provenance mapping table from an attribute.
Creates a new table mapping provenance tokens to values of a given attribute, for use with semiring evaluation functions.
| newtbl | name of the mapping table to create |
| oldtbl | source table with provenance tracking |
| att | attribute whose values populate the mapping |
| preserve_case | if true, quote the table name to preserve case |
| TRIGGER provsql.delete_statement_trigger | ( | ) |
Trigger function for DELETE statement provenance tracking.
Records the deletion and applies monus to provenance tokens of deleted rows. This is the version for PostgreSQL < 14.
| VOID provsql.remove_provenance | ( | REGCLASS | _tbl | ) |
Remove provenance tracking from a table.
Drops the provsql column and associated triggers.
| _tbl | the table to remove provenance tracking from |
| VOID provsql.repair_key | ( | REGCLASS | _tbl, |
| TEXT | key_att | ||
| ) |
Set up provenance for a table with duplicate key values.
When a table has duplicate rows for a given key, this function replaces simple input gates with multivalued input (mulinput) gates that model a uniform distribution over duplicates.
| _tbl | the table to repair |
| key_att | the key attribute(s) as a comma-separated string, or empty string if the whole table is one group |