PostgreSQL Source Code  git master
plpy_plpymodule.c
Go to the documentation of this file.
1 /*
2  * the plpy module
3  *
4  * src/pl/plpython/plpy_plpymodule.c
5  */
6 
7 #include "postgres.h"
8 
9 #include "access/xact.h"
10 #include "mb/pg_wchar.h"
11 #include "plpy_cursorobject.h"
12 #include "plpy_elog.h"
13 #include "plpy_main.h"
14 #include "plpy_planobject.h"
15 #include "plpy_plpymodule.h"
16 #include "plpy_resultobject.h"
17 #include "plpy_spi.h"
18 #include "plpy_subxactobject.h"
19 #include "plpython.h"
20 #include "utils/builtins.h"
21 #include "utils/snapmgr.h"
22 
24 
25 
26 static void PLy_add_exceptions(PyObject *plpy);
27 static PyObject *PLy_create_exception(char *name,
28  PyObject *base, PyObject *dict,
29  const char *modname, PyObject *mod);
30 static void PLy_generate_spi_exceptions(PyObject *mod, PyObject *base);
31 
32 /* module functions */
33 static PyObject *PLy_debug(PyObject *self, PyObject *args, PyObject *kw);
34 static PyObject *PLy_log(PyObject *self, PyObject *args, PyObject *kw);
35 static PyObject *PLy_info(PyObject *self, PyObject *args, PyObject *kw);
36 static PyObject *PLy_notice(PyObject *self, PyObject *args, PyObject *kw);
37 static PyObject *PLy_warning(PyObject *self, PyObject *args, PyObject *kw);
38 static PyObject *PLy_error(PyObject *self, PyObject *args, PyObject *kw);
39 static PyObject *PLy_fatal(PyObject *self, PyObject *args, PyObject *kw);
40 static PyObject *PLy_quote_literal(PyObject *self, PyObject *args);
41 static PyObject *PLy_quote_nullable(PyObject *self, PyObject *args);
42 static PyObject *PLy_quote_ident(PyObject *self, PyObject *args);
43 
44 
45 /* A list of all known exceptions, generated from backend/utils/errcodes.txt */
46 typedef struct ExceptionMap
47 {
48  char *name;
49  char *classname;
50  int sqlstate;
52 
53 static const ExceptionMap exception_map[] = {
54 #include "spiexceptions.h"
55  {NULL, NULL, 0}
56 };
57 
58 static PyMethodDef PLy_methods[] = {
59  /*
60  * logging methods
61  */
62  {"debug", (PyCFunction) (pg_funcptr_t) PLy_debug, METH_VARARGS | METH_KEYWORDS, NULL},
63  {"log", (PyCFunction) (pg_funcptr_t) PLy_log, METH_VARARGS | METH_KEYWORDS, NULL},
64  {"info", (PyCFunction) (pg_funcptr_t) PLy_info, METH_VARARGS | METH_KEYWORDS, NULL},
65  {"notice", (PyCFunction) (pg_funcptr_t) PLy_notice, METH_VARARGS | METH_KEYWORDS, NULL},
66  {"warning", (PyCFunction) (pg_funcptr_t) PLy_warning, METH_VARARGS | METH_KEYWORDS, NULL},
67  {"error", (PyCFunction) (pg_funcptr_t) PLy_error, METH_VARARGS | METH_KEYWORDS, NULL},
68  {"fatal", (PyCFunction) (pg_funcptr_t) PLy_fatal, METH_VARARGS | METH_KEYWORDS, NULL},
69 
70  /*
71  * create a stored plan
72  */
73  {"prepare", PLy_spi_prepare, METH_VARARGS, NULL},
74 
75  /*
76  * execute a plan or query
77  */
78  {"execute", PLy_spi_execute, METH_VARARGS, NULL},
79 
80  /*
81  * escaping strings
82  */
83  {"quote_literal", PLy_quote_literal, METH_VARARGS, NULL},
84  {"quote_nullable", PLy_quote_nullable, METH_VARARGS, NULL},
85  {"quote_ident", PLy_quote_ident, METH_VARARGS, NULL},
86 
87  /*
88  * create the subtransaction context manager
89  */
90  {"subtransaction", PLy_subtransaction_new, METH_NOARGS, NULL},
91 
92  /*
93  * create a cursor
94  */
95  {"cursor", PLy_cursor, METH_VARARGS, NULL},
96 
97  /*
98  * transaction control
99  */
100  {"commit", PLy_commit, METH_NOARGS, NULL},
101  {"rollback", PLy_rollback, METH_NOARGS, NULL},
102 
103  {NULL, NULL, 0, NULL}
104 };
105 
106 static PyMethodDef PLy_exc_methods[] = {
107  {NULL, NULL, 0, NULL}
108 };
109 
110 static PyModuleDef PLy_module = {
111  PyModuleDef_HEAD_INIT,
112  .m_name = "plpy",
113  .m_size = -1,
114  .m_methods = PLy_methods,
115 };
116 
117 static PyModuleDef PLy_exc_module = {
118  PyModuleDef_HEAD_INIT,
119  .m_name = "spiexceptions",
120  .m_size = -1,
121  .m_methods = PLy_exc_methods,
122 };
123 
124 /*
125  * Must have external linkage, because PyMODINIT_FUNC does dllexport on
126  * Windows-like platforms.
127  */
128 PyMODINIT_FUNC
130 {
131  PyObject *m;
132 
133  m = PyModule_Create(&PLy_module);
134  if (m == NULL)
135  return NULL;
136 
138 
139  return m;
140 }
141 
142 void
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 }
173 
174 static void
175 PLy_add_exceptions(PyObject *plpy)
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 }
206 
207 /*
208  * Create an exception object and add it to the module
209  */
210 static PyObject *
211 PLy_create_exception(char *name, PyObject *base, PyObject *dict,
212  const char *modname, PyObject *mod)
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 }
235 
236 /*
237  * Add all the autogenerated exceptions as subclasses of SPIError
238  */
239 static void
240 PLy_generate_spi_exceptions(PyObject *mod, PyObject *base)
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 }
271 
272 
273 /*
274  * the python interface to the elog function
275  * don't confuse these with PLy_elog
276  */
277 static PyObject *PLy_output(volatile int level, PyObject *self,
278  PyObject *args, PyObject *kw);
279 
280 static PyObject *
281 PLy_debug(PyObject *self, PyObject *args, PyObject *kw)
282 {
283  return PLy_output(DEBUG2, self, args, kw);
284 }
285 
286 static PyObject *
287 PLy_log(PyObject *self, PyObject *args, PyObject *kw)
288 {
289  return PLy_output(LOG, self, args, kw);
290 }
291 
292 static PyObject *
293 PLy_info(PyObject *self, PyObject *args, PyObject *kw)
294 {
295  return PLy_output(INFO, self, args, kw);
296 }
297 
298 static PyObject *
299 PLy_notice(PyObject *self, PyObject *args, PyObject *kw)
300 {
301  return PLy_output(NOTICE, self, args, kw);
302 }
303 
304 static PyObject *
305 PLy_warning(PyObject *self, PyObject *args, PyObject *kw)
306 {
307  return PLy_output(WARNING, self, args, kw);
308 }
309 
310 static PyObject *
311 PLy_error(PyObject *self, PyObject *args, PyObject *kw)
312 {
313  return PLy_output(ERROR, self, args, kw);
314 }
315 
316 static PyObject *
317 PLy_fatal(PyObject *self, PyObject *args, PyObject *kw)
318 {
319  return PLy_output(FATAL, self, args, kw);
320 }
321 
322 static PyObject *
323 PLy_quote_literal(PyObject *self, PyObject *args)
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 }
338 
339 static PyObject *
340 PLy_quote_nullable(PyObject *self, PyObject *args)
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 }
358 
359 static PyObject *
360 PLy_quote_ident(PyObject *self, PyObject *args)
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 }
374 
375 /* enforce cast of object to string */
376 static char *
377 object_to_string(PyObject *obj)
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 }
396 
397 static PyObject *
398 PLy_output(volatile int level, PyObject *self, PyObject *args, PyObject *kw)
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:1189
void(* pg_funcptr_t)(void)
Definition: c.h:351
void * hash_search(HTAB *hashp, const void *keyPtr, HASHACTION action, bool *foundPtr)
Definition: dynahash.c:954
HTAB * hash_create(const char *tabname, long nelem, const HASHCTL *info, int flags)
Definition: dynahash.c:349
int err_generic_string(int field, const char *str)
Definition: elog.c:1346
int errmsg_internal(const char *fmt,...)
Definition: elog.c:991
void FreeErrorData(ErrorData *edata)
Definition: elog.c:1611
int errdetail_internal(const char *fmt,...)
Definition: elog.c:1064
void FlushErrorState(void)
Definition: elog.c:1649
int errhint(const char *fmt,...)
Definition: elog.c:1151
char * unpack_sql_state(int sql_state)
Definition: elog.c:2798
int errcode(int sqlerrcode)
Definition: elog.c:693
ErrorData * CopyErrorData(void)
Definition: elog.c:1555
#define LOG
Definition: elog.h:25
#define PG_END_TRY()
Definition: elog.h:324
#define FATAL
Definition: elog.h:35
#define PG_TRY()
Definition: elog.h:299
#define WARNING
Definition: elog.h:30
#define DEBUG2
Definition: elog.h:23
#define ERROR
Definition: elog.h:33
#define MAKE_SQLSTATE(ch1, ch2, ch3, ch4, ch5)
Definition: elog.h:50
#define TEXTDOMAIN
Definition: elog.h:146
#define PG_CATCH()
Definition: elog.h:309
#define NOTICE
Definition: elog.h:29
#define INFO
Definition: elog.h:28
#define ereport(elevel,...)
Definition: elog.h:143
const char * name
Definition: encode.c:561
@ HASH_ENTER
Definition: hsearch.h:114
#define HASH_ELEM
Definition: hsearch.h:95
#define HASH_BLOBS
Definition: hsearch.h:97
static struct @151 value
int i
Definition: isn.c:73
#define PLy_elog
Assert(fmt[strlen(fmt) - 1] !='\n')
bool pg_verifymbstr(const char *mbstr, int len, bool noError)
Definition: mbutils.c:1505
char * pstrdup(const char *in)
Definition: mcxt.c:1305
void pfree(void *pointer)
Definition: mcxt.c:1175
MemoryContext CurrentMemoryContext
Definition: mcxt.c:42
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition: palloc.h:109
PyObject * PLy_cursor(PyObject *self, PyObject *args)
void PLy_cursor_init_type(void)
PyObject * PLy_exc_error
Definition: plpy_elog.c:15
PyObject * PLy_exc_spi_error
Definition: plpy_elog.c:17
void PLy_exception_set_with_details(PyObject *excclass, ErrorData *edata)
Definition: plpy_elog.c:507
void PLy_exception_set(PyObject *exc, const char *fmt,...)
Definition: plpy_elog.c:475
PyObject * PLy_exc_fatal
Definition: plpy_elog.c:16
void PLy_plan_init_type(void)
static char * object_to_string(PyObject *obj)
PyMODINIT_FUNC PyInit_plpy(void)
static PyObject * PLy_notice(PyObject *self, PyObject *args, PyObject *kw)
static PyMethodDef PLy_exc_methods[]
static PyObject * PLy_quote_ident(PyObject *self, PyObject *args)
static PyObject * PLy_debug(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * PLy_quote_nullable(PyObject *self, PyObject *args)
static void PLy_generate_spi_exceptions(PyObject *mod, PyObject *base)
static PyModuleDef PLy_module
static PyObject * PLy_error(PyObject *self, PyObject *args, PyObject *kw)
void PLy_init_plpy(void)
static PyObject * PLy_log(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * PLy_warning(PyObject *self, PyObject *args, PyObject *kw)
static PyObject * PLy_create_exception(char *name, PyObject *base, PyObject *dict, const char *modname, PyObject *mod)
static PyObject * PLy_quote_literal(PyObject *self, PyObject *args)
struct ExceptionMap ExceptionMap
static PyMethodDef PLy_methods[]
static PyModuleDef PLy_exc_module
static PyObject * PLy_output(volatile int level, PyObject *self, PyObject *args, PyObject *kw)
static PyObject * PLy_info(PyObject *self, PyObject *args, PyObject *kw)
HTAB * PLy_spi_exceptions
static PyObject * PLy_fatal(PyObject *self, PyObject *args, PyObject *kw)
static const ExceptionMap exception_map[]
static void PLy_add_exceptions(PyObject *plpy)
void PLy_result_init_type(void)
PyObject * PLy_spi_prepare(PyObject *self, PyObject *args)
Definition: plpy_spi.c:39
PyObject * PLy_spi_execute(PyObject *self, PyObject *args)
Definition: plpy_spi.c:154
PyObject * PLy_rollback(PyObject *self, PyObject *args)
Definition: plpy_spi.c:505
PyObject * PLy_commit(PyObject *self, PyObject *args)
Definition: plpy_spi.c:458
struct PLyExceptionEntry PLyExceptionEntry
PyObject * PLy_subtransaction_new(PyObject *self, PyObject *unused)
void PLy_subtransaction_init_type(void)
char * PLyUnicode_AsString(PyObject *unicode)
Definition: plpy_util.c:83
PyObject * PLyUnicode_FromString(const char *s)
Definition: plpy_util.c:118
#define PG_DIAG_SCHEMA_NAME
Definition: postgres_ext.h:65
#define PG_DIAG_CONSTRAINT_NAME
Definition: postgres_ext.h:69
#define PG_DIAG_DATATYPE_NAME
Definition: postgres_ext.h:68
#define PG_DIAG_TABLE_NAME
Definition: postgres_ext.h:66
#define PG_DIAG_COLUMN_NAME
Definition: postgres_ext.h:67
char * quote_literal_cstr(const char *rawstr)
Definition: quote.c:102
const char * quote_identifier(const char *ident)
Definition: ruleutils.c:12189
Size keysize
Definition: hsearch.h:75
Size entrysize
Definition: hsearch.h:76
Definition: dynahash.c:220
PyObject * exc
Definition: plpy_spi.h:21