Veil2
Postgres extension for VPD implementations
|
Main header file for veil2. More...
Go to the source code of this file.
Data Structures | |
struct | tuple_2ints |
Macros | |
#define | DOCS_PATH "<path to postgres extension docs>" |
#define | DATA_PATH "<path to postgres extension data files>" |
Typedefs | |
typedef bool() | Fetch_fn(HeapTuple, TupleDesc, void *) |
Functions | |
void | veil2_spi_connect (bool *p_pushed, const char *msg) |
void | veil2_spi_finish (bool pushed, const char *msg) |
int | veil2_query_wn (const char *qry, int nargs, Oid *argtypes, Datum *args, const char *nulls, bool read_only, void **saved_plan, Fetch_fn process_row, void *fn_param) |
int | veil2_query (const char *qry, int nargs, Oid *argtypes, Datum *args, bool read_only, void **saved_plan, Fetch_fn process_row, void *fn_param) |
bool | veil2_bool_from_query (const char *qry, int nargs, Oid *argtypes, Datum *args, void **saved_plan, bool *result) |
Datum | veil2_session_ready (PG_FUNCTION_ARGS) |
Datum | veil2_reset_session (PG_FUNCTION_ARGS) |
Datum | veil2_reset_session_privs (PG_FUNCTION_ARGS) |
Datum | veil2_session_context (PG_FUNCTION_ARGS) |
Datum | veil2_session_privileges (PG_FUNCTION_ARGS) |
Datum | veil2_add_session_privileges (PG_FUNCTION_ARGS) |
Datum | veil2_update_session_privileges (PG_FUNCTION_ARGS) |
Datum | veil2_true (PG_FUNCTION_ARGS) |
Datum | veil2_i_have_global_priv (PG_FUNCTION_ARGS) |
Datum | veil2_i_have_personal_priv (PG_FUNCTION_ARGS) |
Datum | veil2_i_have_priv_in_scope (PG_FUNCTION_ARGS) |
Datum | veil2_i_have_priv_in_scope_or_global (PG_FUNCTION_ARGS) |
Datum | veil2_i_have_priv_in_superior_scope (PG_FUNCTION_ARGS) |
Datum | veil2_i_have_priv_in_scope_or_superior (PG_FUNCTION_ARGS) |
Datum | veil2_i_have_priv_in_scope_or_superior_or_global (PG_FUNCTION_ARGS) |
Datum | veil2_result_counts (PG_FUNCTION_ARGS) |
Datum | veil2_docpath (PG_FUNCTION_ARGS) |
Datum | veil2_datapath (PG_FUNCTION_ARGS) |
Datum | veil2_version (PG_FUNCTION_ARGS) |
Main header file for veil2.
Definition in file veil2.h.
typedef bool() Fetch_fn(HeapTuple, TupleDesc, void *) |
Datum veil2_add_session_privileges | ( | PG_FUNCTION_ARGS | ) |
bool veil2_bool_from_query | ( | const char * | qry, |
int | nargs, | ||
Oid * | argtypes, | ||
Datum * | args, | ||
void ** | saved_plan, | ||
bool * | result | ||
) |
Executes a query that returns a single bool value.
qry | The text of the query to be performed. |
nargs | The number of input parameters ($1, $2, etc) to the query |
argtypes | Pointer to an array containing the OIDs of the data |
args | Actual parameters |
saved_plan | Adress of void pointer into which the query plan will be saved. Passing the same void pointer on a subsequent call will cause the saved query plan to be re-used. This may be NULL, in which case the query plan will not be saved. |
result | Variable into which the result of the query will be placed. |
Definition at line 267 of file query.c.
Datum veil2_datapath | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_docpath | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_i_have_global_priv | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_i_have_personal_priv | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_i_have_priv_in_scope | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_i_have_priv_in_scope_or_global | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_i_have_priv_in_scope_or_superior | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_i_have_priv_in_scope_or_superior_or_global | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_i_have_priv_in_superior_scope | ( | PG_FUNCTION_ARGS | ) |
int veil2_query | ( | const char * | qry, |
int | nargs, | ||
Oid * | argtypes, | ||
Datum * | args, | ||
bool | read_only, | ||
void ** | saved_plan, | ||
Fetch_fn | process_row, | ||
void * | fn_param | ||
) |
Execute a query (with all args being non-null) and process the results.
qry | The text of the SQL query to be performed. |
nargs | The number of input parameters ($1, $2, etc) to the query |
argtypes | Pointer to an array containing the OIDs of the data |
args | Actual parameters types of the parameters |
read_only | Whether the query should be read-only or not. |
saved_plan | Adress of void pointer into which the query plan will be saved. Passing the same void pointer on a subsequent call will cause the saved query plan to be re-used. This may be NULL, in which case the query plan will not be saved. |
process_row | A Fetch_fn() to process each tuple retruned by the query. |
fn_param | A parameter to pass to process_row. |
Definition at line 218 of file query.c.
int veil2_query_wn | ( | const char * | qry, |
int | nargs, | ||
Oid * | argtypes, | ||
Datum * | args, | ||
const char * | nulls, | ||
bool | read_only, | ||
void ** | saved_plan, | ||
Fetch_fn | process_row, | ||
void * | fn_param | ||
) |
Execute a query with nulls (ie allowing null arguments) and process the results.
qry | The text of the SQL query to be performed. |
nargs | The number of input parameters ($1, $2, etc) to the query |
argtypes | Pointer to an array containing the OIDs of the data |
args | Actual parameters types of the parameters |
nulls | String identifying which args are null. Null args contain 'n' in the appropriate character position, otherwise there will be a space. If no args may be null, a NULL value can be used instead of a string. |
read_only | Whether the query should be read-only or not. |
saved_plan | Adress of void pointer into which the query plan will be saved. Passing the same void pointer on a subsequent call will cause the saved query plan to be re-used. This may be NULL, in which case the query plan will not be saved. |
process_row | A Fetch_fn() to process each tuple retruned by the query. |
fn_param | A parameter to pass to process_row. |
Definition at line 165 of file query.c.
Datum veil2_reset_session | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_reset_session_privs | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_result_counts | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_session_context | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_session_privileges | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_session_ready | ( | PG_FUNCTION_ARGS | ) |
void veil2_spi_connect | ( | bool * | p_pushed, |
const char * | msg | ||
) |
If already connected in this session, push the current connection, and get a new one. We are already connected, if:
p_pushed | Pointer to a boolean into which we will record whether we have saved a presiously active SPI connection. This allows recursive queries, which is probably overkill for our needs, but since the overhead is low... |
msg | An error message string to be issued in the event of a failure. |
void veil2_spi_finish | ( | bool | pushed, |
const char * | msg | ||
) |
Reciprocal function for veil2_spi_connect()
pushed | Boolean as set up by veil2_spi_connect(). This tells us whether to revert to a previously active SPI connection. |
msg | An error message string to be issued in the event of a failure. |
Datum veil2_true | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_update_session_privileges | ( | PG_FUNCTION_ARGS | ) |
Datum veil2_version | ( | PG_FUNCTION_ARGS | ) |