PostgreSQL Source Code  git master
plpy_plpymodule.c File Reference
#include "postgres.h"
#include "access/xact.h"
#include "mb/pg_wchar.h"
#include "plpy_cursorobject.h"
#include "plpy_elog.h"
#include "plpy_main.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 "utils/snapmgr.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 377 of file plpy_plpymodule.c.

378 {
379  if (obj)
380  {
381  PyObject *so = PyObject_Str(obj);
382 
383  if (so != NULL)
384  {
385  char *str;
386 
388  Py_DECREF(so);
389 
390  return str;
391  }
392  }
393 
394  return NULL;
395 }
const char * str
char * pstrdup(const char *in)
Definition: mcxt.c:1695
char * PLyUnicode_AsString(PyObject *unicode)
Definition: plpy_util.c:83

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

Referenced by PLy_output().

◆ PLy_add_exceptions()

static void PLy_add_exceptions ( PyObject *  plpy)
static

Definition at line 175 of file plpy_plpymodule.c.

176 {
177  PyObject *excmod;
178  HASHCTL hash_ctl;
179 
180  excmod = PyModule_Create(&PLy_exc_module);
181  if (excmod == NULL)
182  PLy_elog(ERROR, "could not create the spiexceptions module");
183 
184  /*
185  * PyModule_AddObject does not add a refcount to the object, for some odd
186  * reason; we must do that.
187  */
188  Py_INCREF(excmod);
189  if (PyModule_AddObject(plpy, "spiexceptions", excmod) < 0)
190  PLy_elog(ERROR, "could not add the spiexceptions module");
191 
192  PLy_exc_error = PLy_create_exception("plpy.Error", NULL, NULL,
193  "Error", plpy);
194  PLy_exc_fatal = PLy_create_exception("plpy.Fatal", NULL, NULL,
195  "Fatal", plpy);
196  PLy_exc_spi_error = PLy_create_exception("plpy.SPIError", NULL, NULL,
197  "SPIError", plpy);
198 
199  hash_ctl.keysize = sizeof(int);
200  hash_ctl.entrysize = sizeof(PLyExceptionEntry);
201  PLy_spi_exceptions = hash_create("PL/Python SPI exceptions", 256,
202  &hash_ctl, HASH_ELEM | HASH_BLOBS);
203 
205 }
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 211 of file plpy_plpymodule.c.

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

282 {
283  return PLy_output(DEBUG2, self, args, kw);
284 }
#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 311 of file plpy_plpymodule.c.

312 {
313  return PLy_output(ERROR, self, args, kw);
314 }

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 317 of file plpy_plpymodule.c.

318 {
319  return PLy_output(FATAL, self, args, kw);
320 }
#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 240 of file plpy_plpymodule.c.

241 {
242  int i;
243 
244  for (i = 0; exception_map[i].name != NULL; i++)
245  {
246  bool found;
247  PyObject *exc;
248  PLyExceptionEntry *entry;
249  PyObject *sqlstate;
250  PyObject *dict = PyDict_New();
251 
252  if (dict == NULL)
253  PLy_elog(ERROR, NULL);
254 
255  sqlstate = PLyUnicode_FromString(unpack_sql_state(exception_map[i].sqlstate));
256  if (sqlstate == NULL)
257  PLy_elog(ERROR, "could not generate SPI exceptions");
258 
259  PyDict_SetItemString(dict, "sqlstate", sqlstate);
260  Py_DECREF(sqlstate);
261 
262  exc = PLy_create_exception(exception_map[i].name, base, dict,
263  exception_map[i].classname, mod);
264 
265  entry = hash_search(PLy_spi_exceptions, &exception_map[i].sqlstate,
266  HASH_ENTER, &found);
267  Assert(!found);
268  entry->exc = exc;
269  }
270 }
#define Assert(condition)
Definition: c.h:858
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:3135
@ HASH_ENTER
Definition: hsearch.h:114
int i
Definition: isn.c:73
static const ExceptionMap exception_map[]
PyObject * PLyUnicode_FromString(const char *s)
Definition: plpy_util.c:118
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 293 of file plpy_plpymodule.c.

294 {
295  return PLy_output(INFO, self, args, kw);
296 }
#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 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 }
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 287 of file plpy_plpymodule.c.

288 {
289  return PLy_output(LOG, self, args, kw);
290 }
#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 299 of file plpy_plpymodule.c.

300 {
301  return PLy_output(NOTICE, self, args, kw);
302 }
#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 398 of file plpy_plpymodule.c.

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

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

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 323 of file plpy_plpymodule.c.

324 {
325  const char *str;
326  char *quoted;
327  PyObject *ret;
328 
329  if (!PyArg_ParseTuple(args, "s:quote_literal", &str))
330  return NULL;
331 
332  quoted = quote_literal_cstr(str);
333  ret = PLyUnicode_FromString(quoted);
334  pfree(quoted);
335 
336  return ret;
337 }
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 340 of file plpy_plpymodule.c.

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

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 305 of file plpy_plpymodule.c.

306 {
307  return PLy_output(WARNING, self, args, kw);
308 }
#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 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

◆ exception_map

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

Definition at line 53 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 106 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 117 of file plpy_plpymodule.c.

Referenced by PLy_add_exceptions().

◆ PLy_methods

PyMethodDef PLy_methods[]
static

Definition at line 58 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 110 of file plpy_plpymodule.c.

Referenced by PLy_init_plpy(), and PyInit_plpy().

◆ PLy_spi_exceptions

HTAB* PLy_spi_exceptions = NULL