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 68 of file plpy_planobject.c.

References PLy_PlanType.

Referenced by PLy_spi_execute().

69 {
70  return ob->ob_type == &PLy_PlanType;
71 }
static PyTypeObject PLy_PlanType

◆ PLy_plan_init_type()

void PLy_plan_init_type ( void  )

Definition at line 43 of file plpy_planobject.c.

References elog, ERROR, and PLy_PlanType.

Referenced by PLy_init_plpy().

44 {
45  if (PyType_Ready(&PLy_PlanType) < 0)
46  elog(ERROR, "could not initialize PLy_PlanType");
47 }
#define ERROR
Definition: elog.h:43
static PyTypeObject PLy_PlanType
#define elog(elevel,...)
Definition: elog.h:228

◆ PLy_plan_new()

PyObject* PLy_plan_new ( void  )

Definition at line 50 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().

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