PostgreSQL Source Code  git master
plpy_plpymodule.c File Reference
#include "postgres.h"
#include "mb/pg_wchar.h"
#include "plpy_cursorobject.h"
#include "plpy_elog.h"
#include "plpy_planobject.h"
#include "plpy_plpymodule.h"
#include "plpy_resultobject.h"
#include "plpy_spi.h"
#include "plpy_subxactobject.h"
#include "plpython.h"
#include "utils/builtins.h"
#include "spiexceptions.h"
Include dependency graph for plpy_plpymodule.c:

Go to the source code of this file.

Data Structures

struct  ExceptionMap
 

Typedefs

typedef struct ExceptionMap ExceptionMap
 

Functions

static void PLy_add_exceptions (PyObject *plpy)
 
static PyObject * PLy_create_exception (char *name, PyObject *base, PyObject *dict, const char *modname, PyObject *mod)
 
static void PLy_generate_spi_exceptions (PyObject *mod, PyObject *base)
 
static PyObject * PLy_debug (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObject * PLy_log (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObject * PLy_info (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObject * PLy_notice (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObject * PLy_warning (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObject * PLy_error (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObject * PLy_fatal (PyObject *self, PyObject *args, PyObject *kw)
 
static PyObject * PLy_quote_literal (PyObject *self, PyObject *args)
 
static PyObject * PLy_quote_nullable (PyObject *self, PyObject *args)
 
static PyObject * PLy_quote_ident (PyObject *self, PyObject *args)
 
PyMODINIT_FUNC PyInit_plpy (void)
 
void PLy_init_plpy (void)
 
static PyObject * PLy_output (volatile int level, PyObject *self, PyObject *args, PyObject *kw)
 
static char * object_to_string (PyObject *obj)
 

Variables

HTABPLy_spi_exceptions = NULL
 
static const ExceptionMap exception_map []
 
static PyMethodDef PLy_methods []
 
static PyMethodDef PLy_exc_methods []
 
static PyModuleDef PLy_module
 
static PyModuleDef PLy_exc_module
 

Typedef Documentation

◆ ExceptionMap

typedef struct ExceptionMap ExceptionMap

Function Documentation

◆ object_to_string()

static char* object_to_string ( PyObject *  obj)
static

Definition at line 374 of file plpy_plpymodule.c.

375 {
376  if (obj)
377  {
378  PyObject *so = PyObject_Str(obj);
379 
380  if (so != NULL)
381  {
382  char *str;
383 
385  Py_DECREF(so);
386 
387  return str;
388  }
389  }
390 
391  return NULL;
392 }
const char * str
char * pstrdup(const char *in)
Definition: mcxt.c:1696
char * PLyUnicode_AsString(PyObject *unicode)
Definition: plpy_util.c:82

References PLyUnicode_AsString(), pstrdup(), and str.

Referenced by PLy_output().

◆ PLy_add_exceptions()

static void PLy_add_exceptions ( PyObject *  plpy)
static

Definition at line 172 of file plpy_plpymodule.c.

173 {
174  PyObject *excmod;
175  HASHCTL hash_ctl;
176 
177  excmod = PyModule_Create(&PLy_exc_module);
178  if (excmod == NULL)
179  PLy_elog(ERROR, "could not create the spiexceptions module");
180 
181  /*
182  * PyModule_AddObject does not add a refcount to the object, for some odd
183  * reason; we must do that.
184  */
185  Py_INCREF(excmod);
186  if (PyModule_AddObject(plpy, "spiexceptions", excmod) < 0)
187  PLy_elog(ERROR, "could not add the spiexceptions module");
188 
189  PLy_exc_error = PLy_create_exception("plpy.Error", NULL, NULL,
190  "Error", plpy);
191  PLy_exc_fatal = PLy_create_exception("plpy.Fatal", NULL, NULL,
192  "Fatal", plpy);
193  PLy_exc_spi_error = PLy_create_exception("plpy.SPIError", NULL, NULL,
194  "SPIError", plpy);
195 
196  hash_ctl.keysize = sizeof(int);
197  hash_ctl.entrysize = sizeof(PLyExceptionEntry);
198  PLy_spi_exceptions = hash_create("PL/Python SPI exceptions", 256,
199  &hash_ctl, HASH_ELEM | HASH_BLOBS);
200 
202 }
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
Definition: dynahash.c:352
#define ERROR
Definition: elog.h:39
#define HASH_ELEM
Definition: hsearch.h:95
#define HASH_BLOBS
Definition: hsearch.h:97
#define PLy_elog
PyObject * PLy_exc_error
Definition: plpy_elog.c:15
PyObject * PLy_exc_spi_error
Definition: plpy_elog.c:17
PyObject * PLy_exc_fatal
Definition: plpy_elog.c:16
static void PLy_generate_spi_exceptions(PyObject *mod, PyObject *base)
static PyObject * PLy_create_exception(char *name, PyObject *base, PyObject *dict, const char *modname, PyObject *mod)
static PyModuleDef PLy_exc_module
HTAB * PLy_spi_exceptions
struct PLyExceptionEntry PLyExceptionEntry
Size keysize
Definition: hsearch.h:75
Size entrysize
Definition: hsearch.h:76

References HASHCTL::entrysize, ERROR, HASH_BLOBS, hash_create(), HASH_ELEM, HASHCTL::keysize, PLy_create_exception(), PLy_elog, PLy_exc_error, PLy_exc_fatal, PLy_exc_module, PLy_exc_spi_error, PLy_generate_spi_exceptions(), and PLy_spi_exceptions.

Referenced by PyInit_plpy().

◆ PLy_create_exception()

static PyObject * PLy_create_exception ( char *  name,
PyObject *  base,
PyObject *  dict,
const char *  modname,
PyObject *  mod 
)
static

Definition at line 208 of file plpy_plpymodule.c.

210 {
211  PyObject *exc;
212 
213  exc = PyErr_NewException(name, base, dict);
214  if (exc == NULL)
215  PLy_elog(ERROR, NULL);
216 
217  /*
218  * PyModule_AddObject does not add a refcount to the object, for some odd
219  * reason; we must do that.
220  */
221  Py_INCREF(exc);
222  PyModule_AddObject(mod, modname, exc);
223 
224  /*
225  * The caller will also store a pointer to the exception object in some
226  * permanent variable, so add another ref to account for that. This is
227  * probably excessively paranoid, but let's be sure.
228  */
229  Py_INCREF(exc);
230  return exc;
231 }
const char * name

References ERROR, name, and PLy_elog.

Referenced by PLy_add_exceptions(), and PLy_generate_spi_exceptions().

◆ PLy_debug()

static PyObject * PLy_debug ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static

Definition at line 278 of file plpy_plpymodule.c.

279 {
280  return PLy_output(DEBUG2, self, args, kw);
281 }
#define DEBUG2
Definition: elog.h:29
static PyObject * PLy_output(volatile int level, PyObject *self, PyObject *args, PyObject *kw)

References generate_unaccent_rules::args, DEBUG2, and PLy_output().

◆ PLy_error()

static PyObject * PLy_error ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static

Definition at line 308 of file plpy_plpymodule.c.

309 {
310  return PLy_output(ERROR, self, args, kw);
311 }

References generate_unaccent_rules::args, ERROR, and PLy_output().

◆ PLy_fatal()

static PyObject * PLy_fatal ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static

Definition at line 314 of file plpy_plpymodule.c.

315 {
316  return PLy_output(FATAL, self, args, kw);
317 }
#define FATAL
Definition: elog.h:41

References generate_unaccent_rules::args, FATAL, and PLy_output().

◆ PLy_generate_spi_exceptions()

static void PLy_generate_spi_exceptions ( PyObject *  mod,
PyObject *  base 
)
static

Definition at line 237 of file plpy_plpymodule.c.

238 {
239  int i;
240 
241  for (i = 0; exception_map[i].name != NULL; i++)
242  {
243  bool found;
244  PyObject *exc;
245  PLyExceptionEntry *entry;
246  PyObject *sqlstate;
247  PyObject *dict = PyDict_New();
248 
249  if (dict == NULL)
250  PLy_elog(ERROR, NULL);
251 
252  sqlstate = PLyUnicode_FromString(unpack_sql_state(exception_map[i].sqlstate));
253  if (sqlstate == NULL)
254  PLy_elog(ERROR, "could not generate SPI exceptions");
255 
256  PyDict_SetItemString(dict, "sqlstate", sqlstate);
257  Py_DECREF(sqlstate);
258 
259  exc = PLy_create_exception(exception_map[i].name, base, dict,
260  exception_map[i].classname, mod);
261 
262  entry = hash_search(PLy_spi_exceptions, &exception_map[i].sqlstate,
263  HASH_ENTER, &found);
264  Assert(!found);
265  entry->exc = exc;
266  }
267 }
#define Assert(condition)
Definition: c.h:837
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
Definition: dynahash.c:955
char * unpack_sql_state(int sql_state)
Definition: elog.c:3169
@ HASH_ENTER
Definition: hsearch.h:114
int i
Definition: isn.c:72
static const ExceptionMap exception_map[]
PyObject * PLyUnicode_FromString(const char *s)
Definition: plpy_util.c:117
PyObject * exc
Definition: plpy_spi.h:21

References Assert, ERROR, PLyExceptionEntry::exc, exception_map, HASH_ENTER, hash_search(), i, name, ExceptionMap::name, PLy_create_exception(), PLy_elog, PLy_spi_exceptions, PLyUnicode_FromString(), and unpack_sql_state().

Referenced by PLy_add_exceptions().

◆ PLy_info()

static PyObject * PLy_info ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static

Definition at line 290 of file plpy_plpymodule.c.

291 {
292  return PLy_output(INFO, self, args, kw);
293 }
#define INFO
Definition: elog.h:34

References generate_unaccent_rules::args, INFO, and PLy_output().

◆ 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 }
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().

◆ PLy_log()

static PyObject * PLy_log ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static

Definition at line 284 of file plpy_plpymodule.c.

285 {
286  return PLy_output(LOG, self, args, kw);
287 }
#define LOG
Definition: elog.h:31

References generate_unaccent_rules::args, LOG, and PLy_output().

◆ PLy_notice()

static PyObject * PLy_notice ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static

Definition at line 296 of file plpy_plpymodule.c.

297 {
298  return PLy_output(NOTICE, self, args, kw);
299 }
#define NOTICE
Definition: elog.h:35

References generate_unaccent_rules::args, NOTICE, and PLy_output().

◆ PLy_output()

static PyObject * PLy_output ( volatile int  level,
PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static

Definition at line 395 of file plpy_plpymodule.c.

396 {
397  int sqlstate = 0;
398  char *volatile sqlstatestr = NULL;
399  char *volatile message = NULL;
400  char *volatile detail = NULL;
401  char *volatile hint = NULL;
402  char *volatile column_name = NULL;
403  char *volatile constraint_name = NULL;
404  char *volatile datatype_name = NULL;
405  char *volatile table_name = NULL;
406  char *volatile schema_name = NULL;
407  volatile MemoryContext oldcontext;
408  PyObject *key,
409  *value;
410  PyObject *volatile so;
411  Py_ssize_t pos = 0;
412 
413  if (PyTuple_Size(args) == 1)
414  {
415  /*
416  * Treat single argument specially to avoid undesirable ('tuple',)
417  * decoration.
418  */
419  PyObject *o;
420 
421  if (!PyArg_UnpackTuple(args, "plpy.elog", 1, 1, &o))
422  PLy_elog(ERROR, "could not unpack arguments in plpy.elog");
423  so = PyObject_Str(o);
424  }
425  else
426  so = PyObject_Str(args);
427 
428  if (so == NULL || ((message = PLyUnicode_AsString(so)) == NULL))
429  {
430  level = ERROR;
431  message = dgettext(TEXTDOMAIN, "could not parse error message in plpy.elog");
432  }
433  message = pstrdup(message);
434 
435  Py_XDECREF(so);
436 
437  if (kw != NULL)
438  {
439  while (PyDict_Next(kw, &pos, &key, &value))
440  {
441  char *keyword = PLyUnicode_AsString(key);
442 
443  if (strcmp(keyword, "message") == 0)
444  {
445  /* the message should not be overwritten */
446  if (PyTuple_Size(args) != 0)
447  {
448  PLy_exception_set(PyExc_TypeError, "argument 'message' given by name and position");
449  return NULL;
450  }
451 
452  if (message)
453  pfree(message);
454  message = object_to_string(value);
455  }
456  else if (strcmp(keyword, "detail") == 0)
457  detail = object_to_string(value);
458  else if (strcmp(keyword, "hint") == 0)
459  hint = object_to_string(value);
460  else if (strcmp(keyword, "sqlstate") == 0)
461  sqlstatestr = object_to_string(value);
462  else if (strcmp(keyword, "schema_name") == 0)
463  schema_name = object_to_string(value);
464  else if (strcmp(keyword, "table_name") == 0)
465  table_name = object_to_string(value);
466  else if (strcmp(keyword, "column_name") == 0)
467  column_name = object_to_string(value);
468  else if (strcmp(keyword, "datatype_name") == 0)
469  datatype_name = object_to_string(value);
470  else if (strcmp(keyword, "constraint_name") == 0)
471  constraint_name = object_to_string(value);
472  else
473  {
474  PLy_exception_set(PyExc_TypeError,
475  "'%s' is an invalid keyword argument for this function",
476  keyword);
477  return NULL;
478  }
479  }
480  }
481 
482  if (sqlstatestr != NULL)
483  {
484  if (strlen(sqlstatestr) != 5)
485  {
486  PLy_exception_set(PyExc_ValueError, "invalid SQLSTATE code");
487  return NULL;
488  }
489 
490  if (strspn(sqlstatestr, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") != 5)
491  {
492  PLy_exception_set(PyExc_ValueError, "invalid SQLSTATE code");
493  return NULL;
494  }
495 
496  sqlstate = MAKE_SQLSTATE(sqlstatestr[0],
497  sqlstatestr[1],
498  sqlstatestr[2],
499  sqlstatestr[3],
500  sqlstatestr[4]);
501  }
502 
503  oldcontext = CurrentMemoryContext;
504  PG_TRY();
505  {
506  if (message != NULL)
507  pg_verifymbstr(message, strlen(message), false);
508  if (detail != NULL)
509  pg_verifymbstr(detail, strlen(detail), false);
510  if (hint != NULL)
511  pg_verifymbstr(hint, strlen(hint), false);
512  if (schema_name != NULL)
513  pg_verifymbstr(schema_name, strlen(schema_name), false);
514  if (table_name != NULL)
515  pg_verifymbstr(table_name, strlen(table_name), false);
516  if (column_name != NULL)
517  pg_verifymbstr(column_name, strlen(column_name), false);
518  if (datatype_name != NULL)
519  pg_verifymbstr(datatype_name, strlen(datatype_name), false);
520  if (constraint_name != NULL)
521  pg_verifymbstr(constraint_name, strlen(constraint_name), false);
522 
523  ereport(level,
524  ((sqlstate != 0) ? errcode(sqlstate) : 0,
525  (message != NULL) ? errmsg_internal("%s", message) : 0,
526  (detail != NULL) ? errdetail_internal("%s", detail) : 0,
527  (hint != NULL) ? errhint("%s", hint) : 0,
528  (column_name != NULL) ?
529  err_generic_string(PG_DIAG_COLUMN_NAME, column_name) : 0,
530  (constraint_name != NULL) ?
531  err_generic_string(PG_DIAG_CONSTRAINT_NAME, constraint_name) : 0,
532  (datatype_name != NULL) ?
533  err_generic_string(PG_DIAG_DATATYPE_NAME, datatype_name) : 0,
534  (table_name != NULL) ?
535  err_generic_string(PG_DIAG_TABLE_NAME, table_name) : 0,
536  (schema_name != NULL) ?
537  err_generic_string(PG_DIAG_SCHEMA_NAME, schema_name) : 0));
538  }
539  PG_CATCH();
540  {
541  ErrorData *edata;
542 
543  MemoryContextSwitchTo(oldcontext);
544  edata = CopyErrorData();
545  FlushErrorState();
546 
548  FreeErrorData(edata);
549 
550  return NULL;
551  }
552  PG_END_TRY();
553 
554  /*
555  * return a legal object so the interpreter will continue on its merry way
556  */
557  Py_RETURN_NONE;
558 }
#define dgettext(d, x)
Definition: c.h:1159
int err_generic_string(int field, const char *str)
Definition: elog.c:1512
int errmsg_internal(const char *fmt,...)
Definition: elog.c:1157
void FreeErrorData(ErrorData *edata)
Definition: elog.c:1818
int errdetail_internal(const char *fmt,...)
Definition: elog.c:1230
void FlushErrorState(void)
Definition: elog.c:1867
int errhint(const char *fmt,...)
Definition: elog.c:1317
int errcode(int sqlerrcode)
Definition: elog.c:853
ErrorData * CopyErrorData(void)
Definition: elog.c:1746
#define PG_TRY(...)
Definition: elog.h:371
#define PG_END_TRY(...)
Definition: elog.h:396
#define PG_CATCH(...)
Definition: elog.h:381
#define MAKE_SQLSTATE(ch1, ch2, ch3, ch4, ch5)
Definition: elog.h:56
#define TEXTDOMAIN
Definition: elog.h:152
#define ereport(elevel,...)
Definition: elog.h:149
static struct @160 value
bool pg_verifymbstr(const char *mbstr, int len, bool noError)
Definition: mbutils.c:1556
void pfree(void *pointer)
Definition: mcxt.c:1521
MemoryContext CurrentMemoryContext
Definition: mcxt.c:143
void PLy_exception_set_with_details(PyObject *excclass, ErrorData *edata)
Definition: plpy_elog.c:504
void PLy_exception_set(PyObject *exc, const char *fmt,...)
Definition: plpy_elog.c:472
static char * object_to_string(PyObject *obj)
#define PG_DIAG_SCHEMA_NAME
Definition: postgres_ext.h:64
#define PG_DIAG_CONSTRAINT_NAME
Definition: postgres_ext.h:68
#define PG_DIAG_DATATYPE_NAME
Definition: postgres_ext.h:67
#define PG_DIAG_TABLE_NAME
Definition: postgres_ext.h:65
#define PG_DIAG_COLUMN_NAME
Definition: postgres_ext.h:66
MemoryContextSwitchTo(old_ctx)

References generate_unaccent_rules::args, CopyErrorData(), CurrentMemoryContext, dgettext, ereport, err_generic_string(), errcode(), errdetail_internal(), errhint(), errmsg_internal(), ERROR, FlushErrorState(), FreeErrorData(), sort-test::key, MAKE_SQLSTATE, MemoryContextSwitchTo(), object_to_string(), pfree(), PG_CATCH, PG_DIAG_COLUMN_NAME, PG_DIAG_CONSTRAINT_NAME, PG_DIAG_DATATYPE_NAME, PG_DIAG_SCHEMA_NAME, PG_DIAG_TABLE_NAME, PG_END_TRY, PG_TRY, pg_verifymbstr(), PLy_elog, PLy_exc_error, PLy_exception_set(), PLy_exception_set_with_details(), PLyUnicode_AsString(), pstrdup(), TEXTDOMAIN, and value.

Referenced by PLy_debug(), PLy_error(), PLy_fatal(), PLy_info(), PLy_log(), PLy_notice(), and PLy_warning().

◆ PLy_quote_ident()

static PyObject * PLy_quote_ident ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 357 of file plpy_plpymodule.c.

358 {
359  const char *str;
360  const char *quoted;
361  PyObject *ret;
362 
363  if (!PyArg_ParseTuple(args, "s:quote_ident", &str))
364  return NULL;
365 
366  quoted = quote_identifier(str);
367  ret = PLyUnicode_FromString(quoted);
368 
369  return ret;
370 }
const char * quote_identifier(const char *ident)
Definition: ruleutils.c:12868

References generate_unaccent_rules::args, PLyUnicode_FromString(), quote_identifier(), and str.

◆ PLy_quote_literal()

static PyObject * PLy_quote_literal ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 320 of file plpy_plpymodule.c.

321 {
322  const char *str;
323  char *quoted;
324  PyObject *ret;
325 
326  if (!PyArg_ParseTuple(args, "s:quote_literal", &str))
327  return NULL;
328 
329  quoted = quote_literal_cstr(str);
330  ret = PLyUnicode_FromString(quoted);
331  pfree(quoted);
332 
333  return ret;
334 }
char * quote_literal_cstr(const char *rawstr)
Definition: quote.c:103

References generate_unaccent_rules::args, pfree(), PLyUnicode_FromString(), quote_literal_cstr(), and str.

◆ PLy_quote_nullable()

static PyObject * PLy_quote_nullable ( PyObject *  self,
PyObject *  args 
)
static

Definition at line 337 of file plpy_plpymodule.c.

338 {
339  const char *str;
340  char *quoted;
341  PyObject *ret;
342 
343  if (!PyArg_ParseTuple(args, "z:quote_nullable", &str))
344  return NULL;
345 
346  if (str == NULL)
347  return PLyUnicode_FromString("NULL");
348 
349  quoted = quote_literal_cstr(str);
350  ret = PLyUnicode_FromString(quoted);
351  pfree(quoted);
352 
353  return ret;
354 }

References generate_unaccent_rules::args, pfree(), PLyUnicode_FromString(), quote_literal_cstr(), and str.

◆ PLy_warning()

static PyObject * PLy_warning ( PyObject *  self,
PyObject *  args,
PyObject *  kw 
)
static

Definition at line 302 of file plpy_plpymodule.c.

303 {
304  return PLy_output(WARNING, self, args, kw);
305 }
#define WARNING
Definition: elog.h:36

References generate_unaccent_rules::args, PLy_output(), and WARNING.

◆ 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

◆ exception_map

const ExceptionMap exception_map[]
static
Initial value:
= {
{NULL, NULL, 0}
}

Definition at line 50 of file plpy_plpymodule.c.

Referenced by PLy_generate_spi_exceptions().

◆ PLy_exc_methods

PyMethodDef PLy_exc_methods[]
static
Initial value:
= {
{NULL, NULL, 0, NULL}
}

Definition at line 103 of file plpy_plpymodule.c.

◆ PLy_exc_module

PyModuleDef PLy_exc_module
static
Initial value:
= {
PyModuleDef_HEAD_INIT,
.m_name = "spiexceptions",
.m_size = -1,
.m_methods = PLy_exc_methods,
}
static PyMethodDef PLy_exc_methods[]

Definition at line 114 of file plpy_plpymodule.c.

Referenced by PLy_add_exceptions().

◆ PLy_methods

PyMethodDef PLy_methods[]
static

Definition at line 55 of file plpy_plpymodule.c.

◆ PLy_module

PyModuleDef PLy_module
static
Initial value:
= {
PyModuleDef_HEAD_INIT,
.m_name = "plpy",
.m_size = -1,
.m_methods = PLy_methods,
}
static PyMethodDef PLy_methods[]

Definition at line 107 of file plpy_plpymodule.c.

Referenced by PLy_init_plpy(), and PyInit_plpy().

◆ PLy_spi_exceptions

HTAB* PLy_spi_exceptions = NULL