#include "utils/hsearch.h"
Go to the source code of this file.
Functions | |
void | PLy_init_plpy (void) |
Variables | |
HTAB * | PLy_spi_exceptions |
void PLy_init_plpy | ( | void | ) |
Definition at line 143 of file plpy_plpymodule.c.
References ERROR, NULL, PLy_add_exceptions(), PLy_cursor_init_type(), PLy_elog(), PLy_methods, PLy_plan_init_type(), PLy_result_init_type(), and PLy_subtransaction_init_type().
Referenced by _PG_init().
{ PyObject *main_mod, *main_dict, *plpy_mod; #if PY_MAJOR_VERSION < 3 PyObject *plpy; #endif /* * initialize plpy module */ PLy_plan_init_type(); PLy_result_init_type(); PLy_subtransaction_init_type(); PLy_cursor_init_type(); #if PY_MAJOR_VERSION >= 3 PyModule_Create(&PLy_module); /* for Python 3 we initialized the exceptions in PyInit_plpy */ #else plpy = Py_InitModule("plpy", PLy_methods); PLy_add_exceptions(plpy); #endif /* PyDict_SetItemString(plpy, "PlanType", (PyObject *) &PLy_PlanType); */ /* * initialize main module, and add plpy */ main_mod = PyImport_AddModule("__main__"); main_dict = PyModule_GetDict(main_mod); plpy_mod = PyImport_AddModule("plpy"); if (plpy_mod == NULL) PLy_elog(ERROR, "could not import \"plpy\" module"); PyDict_SetItemString(main_dict, "plpy", plpy_mod); if (PyErr_Occurred()) PLy_elog(ERROR, "could not import \"plpy\" module"); }
Definition at line 24 of file plpy_plpymodule.c.
Referenced by PLy_spi_subtransaction_abort().