![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Uniform error-reporting macros for ProvSQL. More...

Go to the source code of this file.
Macros | |
| #define | provsql_error(fmt, ...) elog(ERROR, "ProvSQL: " fmt, ##__VA_ARGS__) |
| Report a fatal ProvSQL error and abort the current transaction. | |
| #define | provsql_warning(fmt, ...) elog(WARNING, "ProvSQL: " fmt, ##__VA_ARGS__) |
| Emit a ProvSQL warning message (execution continues). | |
| #define | provsql_notice(fmt, ...) elog(NOTICE, "ProvSQL: " fmt, ##__VA_ARGS__) |
| Emit a ProvSQL informational notice (execution continues). | |
| #define | provsql_log(fmt, ...) elog(LOG, "ProvSQL: " fmt, ##__VA_ARGS__) |
| Write a ProvSQL message to the server log only. | |
Uniform error-reporting macros for ProvSQL.
Defines four convenience macros that wrap PostgreSQL's elog() and always prefix the user-visible message with "ProvSQL: ", giving every diagnostic a consistent origin tag regardless of which source file emits it.
The prefix is inserted by compile-time string-literal concatenation, so fmt must be a string literal (not a runtime char* variable).
This header intentionally contains no #include directives. The caller is responsible for making elog() visible before including this header:
elog() comes from <utils/elog.h>, pulled in transitively through postgres.h or provsql_utils.h (which already includes this file at its end).tdkc binary, BooleanCircuit.cpp defines a lightweight #define elog stub that writes to stderr and calls exit() on ERROR; provsql_error.h is included after that stub. Definition in file provsql_error.h.
| #define provsql_error | ( | fmt, | |
| ... | |||
| ) | elog(ERROR, "ProvSQL: " fmt, ##__VA_ARGS__) |
Report a fatal ProvSQL error and abort the current transaction.
Expands to elog(ERROR, "ProvSQL: " fmt, ...). In PostgreSQL, ERROR performs a non-local exit via longjmp; the call never returns. In the standalone tdkc build the elog stub calls exit(EXIT_FAILURE).
| fmt | A string literal format string (printf-style). |
| ... | Optional format arguments. |
Definition at line 38 of file provsql_error.h.
| #define provsql_log | ( | fmt, | |
| ... | |||
| ) | elog(LOG, "ProvSQL: " fmt, ##__VA_ARGS__) |
Write a ProvSQL message to the server log only.
Expands to elog(LOG, "ProvSQL: " fmt, ...). LOG messages go to the PostgreSQL server log and are not forwarded to the client. Suitable for background-worker lifecycle events (e.g. worker startup).
| fmt | A string literal format string (printf-style). |
| ... | Optional format arguments. |
Definition at line 73 of file provsql_error.h.
| #define provsql_notice | ( | fmt, | |
| ... | |||
| ) | elog(NOTICE, "ProvSQL: " fmt, ##__VA_ARGS__) |
Emit a ProvSQL informational notice (execution continues).
Expands to elog(NOTICE, "ProvSQL: " fmt, ...). Typically used for progress messages gated on provsql.verbose_level.
| fmt | A string literal format string (printf-style). |
| ... | Optional format arguments. |
Definition at line 61 of file provsql_error.h.
| #define provsql_warning | ( | fmt, | |
| ... | |||
| ) | elog(WARNING, "ProvSQL: " fmt, ##__VA_ARGS__) |
Emit a ProvSQL warning message (execution continues).
Expands to elog(WARNING, "ProvSQL: " fmt, ...). The message is sent to the client and server log according to the PostgreSQL log_min_messages / client_min_messages settings.
| fmt | A string literal format string (printf-style). |
| ... | Optional format arguments. |
Definition at line 50 of file provsql_error.h.