Routines

Routines

Name Type Language Deterministic Return Type Security Restriction Comments
trig_b_iu_set_diagnostic_columns() FUNCTION plpgsql false trigger INVOKER

Automatically maintains the common table diagnostic columns whenever data is inserted or updated.

General Usage

For UPDATE transactions, the trigger will determine if there are ‘real data changes’, meaning any fields other than the common diagnostic columns being changed by the transaction. If not, only the diag_update_count column will be updated.

To use this trigger, the targeted table must have the following columns / types defined:

  • diag_timestamp_created / timestamptz

  • diag_role_created / text

  • diag_timestamp_modified / timestamptz

  • diag_wallclock_modified / timestamptz

  • diag_role_modified / text

  • diag_row_version / bigint

  • diag_update_count / bigint

get_exception_details(p_proc_schema text, p_proc_name text, p_exception_name text, p_errcode text, p_param_data jsonb, p_context_data jsonb) FUNCTION sql false text INVOKER

Returns exception details based on the passed parameters represented as a pretty-printed JSON object. The returned value is intended to standardize the details related to RAISEd exceptions and be suitable for use in setting the RAISE DETAILS variable.

Parameters

  • p_proc_schema :: Required? True; Default: ( No Default )

    The schema name hosting the function or store procedure which raised the exception.

  • p_proc_name :: Required? True; Default: ( No Default )

    The name of the process which raised the exception.

  • p_exception_name :: Required? True; Default: ( No Default )

    A standard name for the exception raised.

  • p_errcode :: Required? True; Default: ( No Default )

    Error code complying with the PostgreSQL standard error codes (https://www.postgresql.org/docs/current/errcodes-appendix.html). Typically this will be a compatible error code made outside of already designated error codes.

  • p_param_data :: Required? False; Default: ( No Default )

    A jsonb object where the keys are relevant parameters.

  • p_context_data :: Required? False; Default: ( No Default )

    A jsonb object encapsulating relevant data which might help in interpreting the exception, if such data exists.