PostgreSQL Source Code  git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 140 of file plpy_plpymodule.c.

141 {
142  PyObject *main_mod,
143  *main_dict,
144  *plpy_mod;
145 
146  /*
147  * initialize plpy module
148  */
153 
154  PyModule_Create(&PLy_module);
155 
156  /* PyDict_SetItemString(plpy, "PlanType", (PyObject *) &PLy_PlanType); */
157 
158  /*
159  * initialize main module, and add plpy
160  */
161  main_mod = PyImport_AddModule("__main__");
162  main_dict = PyModule_GetDict(main_mod);
163  plpy_mod = PyImport_AddModule("plpy");
164  if (plpy_mod == NULL)
165  PLy_elog(ERROR, "could not import \"plpy\" module");
166  PyDict_SetItemString(main_dict, "plpy", plpy_mod);
167  if (PyErr_Occurred())
168  PLy_elog(ERROR, "could not import \"plpy\" module");
169 }
#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 126 of file plpy_plpymodule.c.

127 {
128  PyObject *m;
129 
130  m = PyModule_Create(&PLy_module);
131  if (m == NULL)
132  return NULL;
133 
135 
136  return m;
137 }
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