PostgreSQL Source Code git master
Data Structures | Typedefs | Functions | Variables
plpy_main.h File Reference
#include "plpy_procedure.h"
Include dependency graph for plpy_main.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

 

Typedefs

 

Functions

 
 

Variables

PyObject *  PLy_interp_globals
 

Typedef Documentation

PLyExecutionContext

Function Documentation

PLy_current_execution_context()

PLyExecutionContext * PLy_current_execution_context ( void  )

Definition at line 391 of file plpy_main.c.

392{
393 if (PLy_execution_contexts == NULL)
394 elog(ERROR, "no Python function is currently executing");
395
397}
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:226
static PLyExecutionContext * PLy_execution_contexts
Definition: plpy_main.c:58

References elog, ERROR, and PLy_execution_contexts.

Referenced by plpython_return_error_callback(), plpython_trigger_error_callback(), PLy_commit(), PLy_cursor_fetch(), PLy_cursor_iternext(), PLy_cursor_plan(), PLy_cursor_query(), PLy_input_convert(), PLy_input_from_tuple(), PLy_rollback(), PLy_spi_execute_fetch_result(), PLy_spi_execute_plan(), PLy_spi_execute_query(), PLy_spi_prepare(), PLy_traceback(), PLyDict_FromComposite(), and PLyObject_ToComposite().

PLy_get_scratch_context()

MemoryContext PLy_get_scratch_context ( PLyExecutionContextcontext )

Definition at line 400 of file plpy_main.c.

401{
402 /*
403 * A scratch context might never be needed in a given plpython procedure,
404 * so allocate it on first request.
405 */
406 if (context->scratch_ctx == NULL)
407 context->scratch_ctx =
409 "PL/Python scratch context",
411 return context->scratch_ctx;
412}
MemoryContext TopTransactionContext
Definition: mcxt.c:171
#define AllocSetContextCreate
Definition: memutils.h:129
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:160
MemoryContext scratch_ctx
Definition: plpy_main.h:21

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, PLyExecutionContext::scratch_ctx, and TopTransactionContext.

Referenced by PLy_input_convert(), and PLy_input_from_tuple().

Variable Documentation

PLy_interp_globals

PyObject* PLy_interp_globals
extern

Definition at line 55 of file plpy_main.c.

Referenced by PLy_init_interp(), and PLy_procedure_compile().

AltStyle によって変換されたページ (->オリジナル) /