![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
PostgreSQL I/O functions and cast for the agg_token composite type.
More...
#include "postgres.h"#include "fmgr.h"#include "catalog/pg_type.h"#include "utils/uuid.h"#include "executor/spi.h"#include "access/htup_details.h"#include "provsql_utils.h"#include "agg_token.h"
Go to the source code of this file.
Functions | |
| Datum | agg_token_in (PG_FUNCTION_ARGS) |
Parse an agg_token value from its text representation. | |
| Datum | agg_token_out (PG_FUNCTION_ARGS) |
Produce a human-readable display string for an agg_token. | |
| Datum | agg_token_cast (PG_FUNCTION_ARGS) |
Cast an agg_token to text, returning only the UUID part. | |
PostgreSQL I/O functions and cast for the agg_token composite type.
Implements the three SQL-callable C functions that back the agg_token type:
agg_token_in() – text → agg_token (input function)agg_token_out() – agg_token → text (output function)agg_token_cast() – agg_token → text (cast, extracts the UUID part)The on-wire text format is ( UUID , value ) where UUID is the 36-character hyphenated UUID of the provenance gate and value is the aggregate running value.
Definition in file agg_token.c.
| Datum agg_token_cast | ( | PG_FUNCTION_ARGS | ) |
Cast an agg_token to text, returning only the UUID part.
This is used when the caller needs the provenance circuit UUID stored in the token rather than the aggregate value.
Definition at line 96 of file agg_token.c.
| Datum agg_token_in | ( | PG_FUNCTION_ARGS | ) |
Parse an agg_token value from its text representation.
Expected format: "( UUID , value )" with a single space around the comma and at the outer parentheses. Raises ERROR on malformed input.
agg_token. Definition at line 34 of file agg_token.c.
| Datum agg_token_out | ( | PG_FUNCTION_ARGS | ) |
Produce a human-readable display string for an agg_token.
Returns "value (*)", i.e. the running value followed by " (*)". This is the output used by EXPLAIN and direct CAST to text.
Definition at line 77 of file agg_token.c.