/* *ErrorSaveContext- *functioncallcontextnodeforhandlingof"soft"errors * *Acallerwishingtotrapsofterrorsmustinitializeastructlikethis *withallfieldszero/NULLexceptfortheNodeTag.Optionally,set *details_wanted=trueifmorethanthebareknowledgethatasofterror *occurredisrequired.ThestructisthenpassedtoaSQL-callablefunction *viatheFunctionCallInfo.contextfield;orbelowthelevelofSQLcalls, *itcouldbepassedtoasubroutinedirectly. * *Aftercallingcodethatmightreportanerrorthisway,check *error_occurredtoseeifanerrorhappened.Ifso,andifdetails_wanted *istrue,error_datahasbeenfilledwitherrordetails(storedinthe *callee'smemorycontext!).TheErrorDatacanbemodified(e.g.downgraded *toaWARNING)andreportedwithThrowErrorData().FreeErrorData()canbe *calledtoreleaseerror_data,althoughthatstepistypicallynotnecessary *ifthecalledcodewasruninashort-livedcontext.
*/ typedefstruct ErrorSaveContext
{
NodeTag type; bool error_occurred; /* set to true if we detect a soft error */ bool details_wanted; /* does caller want more info than that? */
ErrorData *error_data; /* details of error, if so */
} ErrorSaveContext;
/* Often-useful macro for checking if a soft error was reported */ #define SOFT_ERROR_OCCURRED(escontext) \
((escontext) != NULL && IsA(escontext, ErrorSaveContext) && \
((ErrorSaveContext *) (escontext))->error_occurred)
#endif/* MISCNODES_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.