#include "postgres.h"#include "plpython.h"#include "plpy_planobject.h"#include "plpy_elog.h"
Go to the source code of this file.
Functions | |
| static void | PLy_plan_dealloc (PyObject *arg) |
| static PyObject * | PLy_plan_status (PyObject *self, PyObject *args) |
| void | PLy_plan_init_type (void) |
| PyObject * | PLy_plan_new (void) |
| bool | is_PLyPlanObject (PyObject *ob) |
Variables | |
| static char | PLy_plan_doc [] |
| static PyMethodDef | PLy_plan_methods [] |
| static PyTypeObject | PLy_PlanType |
| bool is_PLyPlanObject | ( | PyObject * | ob | ) |
Definition at line 88 of file plpy_planobject.c.
References PLy_PlanType.
Referenced by PLy_spi_execute().
{
return ob->ob_type == &PLy_PlanType;
}
| static void PLy_plan_dealloc | ( | PyObject * | arg | ) | [static] |
Definition at line 94 of file plpy_planobject.c.
References PLyPlanObject::args, i, PLyPlanObject::nargs, PLyPlanObject::plan, PLy_free(), PLy_typeinfo_dealloc(), SPI_freeplan(), PLyPlanObject::types, and PLyPlanObject::values.
| void PLy_plan_init_type | ( | void | ) |
Definition at line 64 of file plpy_planobject.c.
References elog, ERROR, and PLy_PlanType.
Referenced by PLy_init_plpy().
{
if (PyType_Ready(&PLy_PlanType) < 0)
elog(ERROR, "could not initialize PLy_PlanType");
}
| PyObject* PLy_plan_new | ( | void | ) |
Definition at line 71 of file plpy_planobject.c.
References PLyPlanObject::args, PLyPlanObject::nargs, NULL, PLyPlanObject::plan, PLy_PlanType, PLyPlanObject::types, and PLyPlanObject::values.
Referenced by PLy_spi_prepare().
{
PLyPlanObject *ob;
if ((ob = PyObject_New(PLyPlanObject, &PLy_PlanType)) == NULL)
return NULL;
ob->plan = NULL;
ob->nargs = 0;
ob->types = NULL;
ob->values = NULL;
ob->args = NULL;
return (PyObject *) ob;
}
| static PyObject * PLy_plan_status | ( | PyObject * | self, | |
| PyObject * | args | |||
| ) | [static] |
Definition at line 118 of file plpy_planobject.c.
References PLy_exc_error, and PLy_exception_set().
{
if (PyArg_ParseTuple(args, ""))
{
Py_INCREF(Py_True);
return Py_True;
/* return PyInt_FromLong(self->status); */
}
PLy_exception_set(PLy_exc_error, "plan.status takes no arguments");
return NULL;
}
char PLy_plan_doc[] [static] |
{
"Store a PostgreSQL plan"
}
Definition at line 19 of file plpy_planobject.c.
PyMethodDef PLy_plan_methods[] [static] |
{
{"status", PLy_plan_status, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
}
Definition at line 23 of file plpy_planobject.c.
PyTypeObject PLy_PlanType [static] |
Definition at line 28 of file plpy_planobject.c.
Referenced by is_PLyPlanObject(), PLy_plan_init_type(), and PLy_plan_new().
1.7.1