ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
provenance.c File Reference

SQL function provenance() – error stub for untracked tables. More...

#include "postgres.h"
#include "fmgr.h"
#include "catalog/pg_type.h"
#include "utils/uuid.h"
#include "executor/spi.h"
#include "provsql_utils.h"
Include dependency graph for provenance.c:

Go to the source code of this file.

Functions

Datum provenance (PG_FUNCTION_ARGS)
 Error stub for provsql.provenance() on untracked tables.
 

Detailed Description

SQL function provenance() – error stub for untracked tables.

The SQL function provsql.provenance() is added to every table that has provenance tracking enabled. When a query references the provsql column of such a table directly (without going through the planner hook), this stub is called and immediately raises an error.

In normal operation the planner hook rewrites queries that reference provenance-tracked tables before this function can be called, so the error message is only seen if provenance() is invoked on a relation that does not have a provsql column.

Definition in file provenance.c.

Function Documentation

◆ provenance()

Datum provenance ( PG_FUNCTION_ARGS  )

Error stub for provsql.provenance() on untracked tables.

Always raises a provsql_error and never returns.

Returns
Never returns (always raises an error).

Definition at line 31 of file provenance.c.

Here is the caller graph for this function: