PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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
 

Typedefs

typedef struct PLyExecutionContext PLyExecutionContext
 

Functions

PLyExecutionContextPLy_current_execution_context (void)
 
MemoryContext PLy_get_scratch_context (PLyExecutionContext *context)
 

Variables

PyObjectPLy_interp_globals
 

Typedef Documentation

◆ PLyExecutionContext

Function Documentation

◆ PLy_current_execution_context()

PLyExecutionContext * PLy_current_execution_context ( void  )
extern

◆ PLy_get_scratch_context()

MemoryContext PLy_get_scratch_context ( PLyExecutionContext context)
extern

Definition at line 345 of file plpy_main.c.

346{
347 /*
348 * A scratch context might never be needed in a given plpython procedure,
349 * so allocate it on first request.
350 */
351 if (context->scratch_ctx == NULL)
352 context->scratch_ctx =
354 "PL/Python scratch context",
356 return context->scratch_ctx;
357}
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, fb(), 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 50 of file plpy_main.c.

Referenced by _PG_init(), and PLy_procedure_compile().