#ifndef QDBPP_UTL_CALL_STACK_HPP
|
#define QDBPP_UTL_CALL_STACK_HPP
|
|
extern "C" {
|
#include "postgres.h"
|
#include "fmgr.h"
|
#include "utils/builtins.h"
|
#include "utils/memutils.h"
|
#include "utils/elog.h"
|
#include "utils/guc.h" // <— добавили
|
#include "miscadmin.h"
|
}
|
|
#define UTL_CALL_STACK_ERR_BAD_DEPTH 64610
|
|
inline void UTL_CALL_STACK_RAISE_BAD_DEPTH()
|
{
|
ereport(ERROR,
|
(errcode(ERRCODE_RAISE_EXCEPTION),
|
errmsg("ORA-64610: BAD_DEPTH_INDICATOR")));
|
}
|
|
extern "C" {
|
// no-arg
|
PGDLLEXPORT Datum utl_call_stack_backtrace_depth(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_dynamic_depth(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_error_depth(PG_FUNCTION_ARGS);
|
|
// int-arg
|
PGDLLEXPORT Datum utl_call_stack_backtrace_line(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_backtrace_unit(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_current_edition(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_error_msg(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_error_number(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_lexical_depth(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_owner(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_unit_line(PG_FUNCTION_ARGS);
|
|
// string
|
PGDLLEXPORT Datum utl_call_stack_subprogram(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_concatenate_subprogram(PG_FUNCTION_ARGS);
|
PGDLLEXPORT Datum utl_call_stack_compose_subprogram(PG_FUNCTION_ARGS);
|
|
PGDLLEXPORT Datum utl_call_stack_get_version(PG_FUNCTION_ARGS);
|
|
void _PG_init(void);
|
void _PG_fini(void);
|
}
|
|
#endif
|