PostgreSQL Source Code  git master
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

struct  PLyExecutionContext


typedef struct PLyExecutionContext PLyExecutionContext


PLyExecutionContextPLy_current_execution_context (void)
MemoryContext PLy_get_scratch_context (PLyExecutionContext *context)


PyObject * PLy_interp_globals

Typedef Documentation

◆ PLyExecutionContext

Function Documentation

◆ PLy_current_execution_context()

PLyExecutionContext* PLy_current_execution_context ( void  )

◆ PLy_get_scratch_context()

MemoryContext PLy_get_scratch_context ( PLyExecutionContext context)

Definition at line 417 of file plpy_main.c.

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

Referenced by PLy_input_convert(), and PLy_input_from_tuple().

418 {
419  /*
420  * A scratch context might never be needed in a given plpython procedure,
421  * so allocate it on first request.
422  */
423  if (context->scratch_ctx == NULL)
424  context->scratch_ctx =
426  "PL/Python scratch context",
428  return context->scratch_ctx;
429 }
MemoryContext scratch_ctx
Definition: plpy_main.h:21
#define AllocSetContextCreate
Definition: memutils.h:173
MemoryContext TopTransactionContext
Definition: mcxt.c:53
Definition: memutils.h:195

Variable Documentation

◆ PLy_interp_globals

PyObject* PLy_interp_globals

Definition at line 67 of file plpy_main.c.

Referenced by PLy_init_interp(), and PLy_procedure_compile().