![]() |
ProvSQL SQL API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Functions for temporal database support. More...
Functions | |
| TSTZMULTIRANGE | provsql.union_tstzintervals_plus_state (TSTZMULTIRANGE state, TSTZMULTIRANGE value) |
| Transition function for temporal union (plus): merge multiranges. | |
| TSTZMULTIRANGE | provsql.union_tstzintervals_times_state (TSTZMULTIRANGE state, TSTZMULTIRANGE value) |
| Transition function for temporal intersection (times): intersect multiranges. | |
| VOID | provsql.union_tstzintervals_plus (TSTZMULTIRANGE) |
| Aggregate: union of TIMESTAMP multiranges (semiring plus) | |
| VOID | provsql.union_tstzintervals_times (TSTZMULTIRANGE) |
| Aggregate: intersection of TIMESTAMP multiranges (semiring times) | |
| TSTZMULTIRANGE | provsql.union_tstzintervals_monus (TSTZMULTIRANGE state, TSTZMULTIRANGE value) |
| Temporal monus: subtract one multirange from another. | |
| TSTZMULTIRANGE | provsql.union_tstzintervals (UUID token, REGCLASS token2value) |
| Evaluate temporal provenance as a TIMESTAMP multirange. | |
| VOID | provsql.create_provenance_mapping_view (TEXT newview, REGCLASS oldtbl, TEXT att, BOOL preserve_case=false) |
| Create a view mapping provenance tokens to attribute values. | |
| SETOF RECORD | provsql.timetravel (TEXT tablename, TIMESTAMPTZ at_time) |
| Query a table as it was at a specific point in time. | |
| SETOF RECORD | provsql.timeslice (TEXT tablename, TIMESTAMPTZ from_time, TIMESTAMPTZ to_time) |
| Query a table for rows valid during a time interval. | |
| SETOF RECORD | provsql.history (TEXT tablename, TEXT[] col_names, TEXT[] col_values) |
| Query the full temporal history of specific rows. | |
| TSTZMULTIRANGE | provsql.get_valid_time (UUID token, TEXT tablename) |
| Get the valid time range for a specific tuple. | |
| UUID | provsql.undo (UUID c) |
| Undo a previously recorded update operation. | |
| UUID | provsql.replace_the_circuit (UUID x, UUID c, UUID u) |
| Recursively rewrite a circuit to undo a specific operation. | |
Functions for temporal database support.
These use provenance evaluation over the multirange semiring to track temporal validity of tuples.
| VOID provsql.create_provenance_mapping_view | ( | TEXT | newview, |
| REGCLASS | oldtbl, | ||
| TEXT | att, | ||
| BOOL | preserve_case = false |
||
| ) |
Create a view mapping provenance tokens to attribute values.
Like create_provenance_mapping but creates a view instead of a table, so it always reflects the current state of the source table.
| newview | name of the view to create |
| oldtbl | source table with provenance tracking |
| att | attribute whose values populate the mapping |
| preserve_case | if true, quote the view name to preserve case |
| TSTZMULTIRANGE provsql.get_valid_time | ( | UUID | token, |
| TEXT | tablename | ||
| ) |
Get the valid time range for a specific tuple.
| token | provenance token of the tuple |
| tablename | name of the table containing the tuple |
| SETOF RECORD provsql.history | ( | TEXT | tablename, |
| TEXT[] | col_names, | ||
| TEXT[] | col_values | ||
| ) |
Query the full temporal history of specific rows.
Returns all versions of rows matching the given column values, with their temporal validity ranges.
| tablename | name of the provenance-tracked table |
| col_names | array of column names to filter on |
| col_values | array of corresponding values to match |
| UUID provsql.replace_the_circuit | ( | UUID | x, |
| UUID | c, | ||
| UUID | u | ||
| ) |
Recursively rewrite a circuit to undo a specific operation.
Helper for undo(). Walks the circuit and replaces occurrences of the target update gate with its monus.
| x | provenance token to rewrite |
| c | UUID of the update operation to undo |
| u | UUID of the undo operation |
| SETOF RECORD provsql.timeslice | ( | TEXT | tablename, |
| TIMESTAMPTZ | from_time, | ||
| TIMESTAMPTZ | to_time | ||
| ) |
Query a table for rows valid during a time interval.
Returns all rows whose temporal validity overlaps the given range.
| tablename | name of the provenance-tracked table |
| from_time | start of the time interval |
| to_time | end of the time interval |
| SETOF RECORD provsql.timetravel | ( | TEXT | tablename, |
| TIMESTAMPTZ | at_time | ||
| ) |
Query a table as it was at a specific point in time.
Returns all rows whose temporal validity includes the given TIMESTAMP.
| tablename | name of the provenance-tracked table |
| at_time | the point in time to query |
| UUID provsql.undo | ( | UUID | c | ) |
Undo a previously recorded update operation.
Traverses all provenance-tracked tables and rewrites their circuits to apply monus with respect to the given update token, effectively undoing the operation.
| c | UUID of the update operation to undo (from update_provenance) |
| TSTZMULTIRANGE provsql.union_tstzintervals | ( | UUID | token, |
| REGCLASS | token2value | ||
| ) |
Evaluate temporal provenance as a TIMESTAMP multirange.
Evaluates provenance over the multirange semiring to compute the valid time intervals of a tuple.
| token | provenance token to evaluate |
| token2value | mapping table from tokens to temporal validity ranges |
| TSTZMULTIRANGE provsql.union_tstzintervals_monus | ( | TSTZMULTIRANGE | state, |
| TSTZMULTIRANGE | value | ||
| ) |
Temporal monus: subtract one multirange from another.
| VOID provsql.union_tstzintervals_plus | ( | TSTZMULTIRANGE | ) |
Aggregate: union of TIMESTAMP multiranges (semiring plus)
| TSTZMULTIRANGE provsql.union_tstzintervals_plus_state | ( | TSTZMULTIRANGE | state, |
| TSTZMULTIRANGE | value | ||
| ) |
Transition function for temporal union (plus): merge multiranges.
| VOID provsql.union_tstzintervals_times | ( | TSTZMULTIRANGE | ) |
Aggregate: intersection of TIMESTAMP multiranges (semiring times)
| TSTZMULTIRANGE provsql.union_tstzintervals_times_state | ( | TSTZMULTIRANGE | state, |
| TSTZMULTIRANGE | value | ||
| ) |
Transition function for temporal intersection (times): intersect multiranges.