PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
plpy_planobject.h File Reference
#include "executor/spi.h"
#include "plpy_typeio.h"
Include dependency graph for plpy_planobject.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PLyPlanObject
 

Typedefs

typedef struct PLyPlanObject PLyPlanObject
 

Functions

void PLy_plan_init_type (void)
 
PyObject * PLy_plan_new (void)
 
bool is_PLyPlanObject (PyObject *ob)
 

Typedef Documentation

◆ PLyPlanObject

typedef struct PLyPlanObject PLyPlanObject

Function Documentation

◆ is_PLyPlanObject()

bool is_PLyPlanObject ( PyObject *  ob)

Definition at line 85 of file plpy_planobject.c.

86{
87 return ob->ob_type == PLy_PlanType;
88}
static PyTypeObject * PLy_PlanType

References PLy_PlanType.

Referenced by PLy_spi_execute().

◆ PLy_plan_init_type()

void PLy_plan_init_type ( void  )

Definition at line 56 of file plpy_planobject.c.

57{
58 PLy_PlanType = (PyTypeObject *) PyType_FromSpec(&PLyPlan_spec);
59 if (!PLy_PlanType)
60 elog(ERROR, "could not initialize PLy_PlanType");
61}
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:225
static PyType_Spec PLyPlan_spec

References elog, ERROR, PLy_PlanType, and PLyPlan_spec.

Referenced by PLy_init_plpy().

◆ PLy_plan_new()

PyObject * PLy_plan_new ( void  )

Definition at line 64 of file plpy_planobject.c.

65{
66 PLyPlanObject *ob;
67
68 if ((ob = PyObject_New(PLyPlanObject, PLy_PlanType)) == NULL)
69 return NULL;
70#if PY_VERSION_HEX < 0x03080000
71 /* Workaround for Python issue 35810; no longer necessary in Python 3.8 */
72 Py_INCREF(PLy_PlanType);
73#endif
74
75 ob->plan = NULL;
76 ob->nargs = 0;
77 ob->types = NULL;
78 ob->args = NULL;
79 ob->mcxt = NULL;
80
81 return (PyObject *) ob;
82}
PyObject_HEAD SPIPlanPtr plan
MemoryContext mcxt
PLyObToDatum * args

References PLyPlanObject::args, PLyPlanObject::mcxt, PLyPlanObject::nargs, PLyPlanObject::plan, PLy_PlanType, and PLyPlanObject::types.

Referenced by PLy_spi_prepare().