PostgreSQL Source Code  git master
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 71 of file plpy_planobject.c.

References PLy_PlanType.

Referenced by PLy_spi_execute().

72 {
73  return ob->ob_type == &PLy_PlanType;
74 }
static PyTypeObject PLy_PlanType

◆ PLy_plan_init_type()

void PLy_plan_init_type ( void  )

Definition at line 46 of file plpy_planobject.c.

References elog, ERROR, and PLy_PlanType.

Referenced by PLy_init_plpy().

47 {
48  if (PyType_Ready(&PLy_PlanType) < 0)
49  elog(ERROR, "could not initialize PLy_PlanType");
50 }
#define ERROR
Definition: elog.h:43
static PyTypeObject PLy_PlanType
#define elog(elevel,...)
Definition: elog.h:226

◆ PLy_plan_new()

PyObject* PLy_plan_new ( void  )

Definition at line 53 of file plpy_planobject.c.

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

Referenced by PLy_spi_prepare().

54 {
55  PLyPlanObject *ob;
56 
57  if ((ob = PyObject_New(PLyPlanObject, &PLy_PlanType)) == NULL)
58  return NULL;
59 
60  ob->plan = NULL;
61  ob->nargs = 0;
62  ob->types = NULL;
63  ob->values = NULL;
64  ob->args = NULL;
65  ob->mcxt = NULL;
66 
67  return (PyObject *) ob;
68 }
static PyTypeObject PLy_PlanType
PLyObToDatum * args
PyObject_HEAD SPIPlanPtr plan
MemoryContext mcxt