PostgreSQL Source Code  git master
plpy_plpymodule.h File Reference
#include "plpython.h"
#include "utils/hsearch.h"
Include dependency graph for plpy_plpymodule.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PyMODINIT_FUNC PyInit_plpy (void)
 
void PLy_init_plpy (void)
 

Variables

HTABPLy_spi_exceptions
 

Function Documentation

◆ PLy_init_plpy()

void PLy_init_plpy ( void  )

Definition at line 143 of file plpy_plpymodule.c.

144 {
145  PyObject *main_mod,
146  *main_dict,
147  *plpy_mod;
148 
149  /*
150  * initialize plpy module
151  */
156 
157  PyModule_Create(&PLy_module);
158 
159  /* PyDict_SetItemString(plpy, "PlanType", (PyObject *) &PLy_PlanType); */
160 
161  /*
162  * initialize main module, and add plpy
163  */
164  main_mod = PyImport_AddModule("__main__");
165  main_dict = PyModule_GetDict(main_mod);
166  plpy_mod = PyImport_AddModule("plpy");
167  if (plpy_mod == NULL)
168  PLy_elog(ERROR, "could not import \"plpy\" module");
169  PyDict_SetItemString(main_dict, "plpy", plpy_mod);
170  if (PyErr_Occurred())
171  PLy_elog(ERROR, "could not import \"plpy\" module");
172 }
#define ERROR
Definition: elog.h:39
#define PLy_elog
void PLy_cursor_init_type(void)
void PLy_plan_init_type(void)
static PyModuleDef PLy_module
void PLy_result_init_type(void)
void PLy_subtransaction_init_type(void)

References ERROR, PLy_cursor_init_type(), PLy_elog, PLy_module, PLy_plan_init_type(), PLy_result_init_type(), and PLy_subtransaction_init_type().

Referenced by PLy_initialize().

◆ PyInit_plpy()

PyMODINIT_FUNC PyInit_plpy ( void  )

Definition at line 129 of file plpy_plpymodule.c.

130 {
131  PyObject *m;
132 
133  m = PyModule_Create(&PLy_module);
134  if (m == NULL)
135  return NULL;
136 
138 
139  return m;
140 }
static void PLy_add_exceptions(PyObject *plpy)

References PLy_add_exceptions(), and PLy_module.

Referenced by PLy_initialize().

Variable Documentation

◆ PLy_spi_exceptions

HTAB* PLy_spi_exceptions
extern