PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "lib/stringinfo.h"
#include "plpy_elog.h"
#include "plpy_main.h"
#include "plpy_procedure.h"
#include "plpython.h"
Go to the source code of this file.
Functions | |
static void | PLy_traceback (PyObject *e, PyObject *v, PyObject *tb, char **xmsg, char **tbmsg, int *tb_depth) |
static void | PLy_get_spi_error_data (PyObject *exc, int *sqlerrcode, char **detail, char **hint, char **query, int *position, char **schema_name, char **table_name, char **column_name, char **datatype_name, char **constraint_name) |
static void | PLy_get_error_data (PyObject *exc, int *sqlerrcode, char **detail, char **hint, char **schema_name, char **table_name, char **column_name, char **datatype_name, char **constraint_name) |
static char * | get_source_line (const char *src, int lineno) |
static void | get_string_attr (PyObject *obj, char *attrname, char **str) |
static bool | set_string_attr (PyObject *obj, char *attrname, char *str) |
void | PLy_elog_impl (int elevel, const char *fmt,...) |
static void | PLy_get_sqlerrcode (PyObject *exc, int *sqlerrcode) |
void | PLy_exception_set (PyObject *exc, const char *fmt,...) |
void | PLy_exception_set_plural (PyObject *exc, const char *fmt_singular, const char *fmt_plural, unsigned long n,...) |
void | PLy_exception_set_with_details (PyObject *excclass, ErrorData *edata) |
Variables | |
PyObject * | PLy_exc_error = NULL |
PyObject * | PLy_exc_fatal = NULL |
PyObject * | PLy_exc_spi_error = NULL |
|
static |
Definition at line 430 of file plpy_elog.c.
References next, pnstrdup(), and pstrdup().
Referenced by PLy_traceback().
|
static |
Definition at line 562 of file plpy_elog.c.
References PLyUnicode_AsString(), pstrdup(), str, and val.
Referenced by PLy_get_error_data().
void PLy_elog_impl | ( | int | elevel, |
const char * | fmt, | ||
... | |||
) |
Definition at line 43 of file plpy_elog.c.
References appendStringInfoVA(), StringInfoData::data, dgettext, enlargeStringInfo(), ereport, err_generic_string(), errcode(), errcontext, errdetail_internal(), errhint(), errmsg_internal(), FATAL, fmt, initStringInfo(), internalerrposition(), internalerrquery(), pfree(), PG_DIAG_COLUMN_NAME, PG_DIAG_CONSTRAINT_NAME, PG_DIAG_DATATYPE_NAME, PG_DIAG_SCHEMA_NAME, PG_DIAG_TABLE_NAME, PG_END_TRY, PG_FINALLY, PG_TRY, PLy_exc_error, PLy_exc_fatal, PLy_exc_spi_error, PLy_get_error_data(), PLy_get_spi_error_data(), PLy_traceback(), TEXTDOMAIN, va_end(), va_start(), and val.
Referenced by _PG_init().
void PLy_exception_set | ( | PyObject * | exc, |
const char * | fmt, | ||
... | |||
) |
Definition at line 472 of file plpy_elog.c.
References buf, dgettext, fmt, TEXTDOMAIN, va_end(), va_start(), and vsnprintf.
Referenced by PLy_cursor(), PLy_cursor_close(), PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_output(), PLy_result_colnames(), PLy_result_coltypes(), PLy_result_coltypmods(), PLy_spi_execute(), PLy_spi_execute_plan(), PLy_spi_execute_query(), PLy_spi_prepare(), PLy_subtransaction_enter(), and PLy_subtransaction_exit().
void PLy_exception_set_plural | ( | PyObject * | exc, |
const char * | fmt_singular, | ||
const char * | fmt_plural, | ||
unsigned long | n, | ||
... | |||
) |
Definition at line 486 of file plpy_elog.c.
References buf, dngettext, TEXTDOMAIN, va_end(), va_start(), and vsnprintf.
Referenced by PLy_cursor_plan(), and PLy_spi_execute_plan().
void PLy_exception_set_with_details | ( | PyObject * | excclass, |
ErrorData * | edata | ||
) |
Definition at line 504 of file plpy_elog.c.
References generate_unaccent_rules::args, ErrorData::column_name, ErrorData::constraint_name, ErrorData::datatype_name, ErrorData::detail, elog, ERROR, error(), ErrorData::hint, ErrorData::internalquery, ErrorData::message, ErrorData::schema_name, set_string_attr(), ErrorData::sqlerrcode, ErrorData::table_name, and unpack_sql_state().
Referenced by PLy_output().
|
static |
Definition at line 412 of file plpy_elog.c.
References get_string_attr(), and PLy_get_sqlerrcode().
Referenced by PLy_elog_impl().
|
static |
Definition at line 376 of file plpy_elog.c.
References PLy_get_sqlerrcode().
Referenced by PLy_elog_impl().
|
static |
Definition at line 352 of file plpy_elog.c.
References MAKE_SQLSTATE, and PLyUnicode_AsString().
Referenced by PLy_get_error_data(), and PLy_get_spi_error_data().
|
static |
Definition at line 162 of file plpy_elog.c.
References appendStringInfo(), appendStringInfoString(), Assert, PLyExecutionContext::curr_proc, StringInfoData::data, elog, ERROR, filename, get_source_line(), initStringInfo(), name, pfree(), PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, PLy_current_execution_context(), PLy_procedure_name(), PLyUnicode_AsString(), proname, and PLyProcedure::src.
Referenced by PLy_elog_impl().
|
static |
Definition at line 578 of file plpy_elog.c.
References PLyUnicode_FromString(), str, and val.
Referenced by PLy_exception_set_with_details().
PyObject* PLy_exc_error = NULL |
Definition at line 15 of file plpy_elog.c.
Referenced by PLy_add_exceptions(), PLy_cursor(), PLy_elog_impl(), PLy_output(), PLy_result_colnames(), PLy_result_coltypes(), PLy_result_coltypmods(), and PLy_spi_execute().
PyObject* PLy_exc_fatal = NULL |
Definition at line 16 of file plpy_elog.c.
Referenced by PLy_add_exceptions(), and PLy_elog_impl().
PyObject* PLy_exc_spi_error = NULL |
Definition at line 17 of file plpy_elog.c.
Referenced by PLy_add_exceptions(), PLy_commit(), PLy_elog_impl(), PLy_rollback(), PLy_spi_execute_plan(), PLy_spi_execute_query(), and PLy_spi_subtransaction_abort().