48 PyVarObject_HEAD_INIT(NULL, 0)
49 .tp_name =
"PLyResult",
55 .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
64 elog(
ERROR,
"could not initialize PLy_ResultType");
79 ob->
nrows = PyLong_FromLong(-1);
80 ob->
rows = PyList_New(0);
88 return (PyObject *) ob;
96 Py_XDECREF(ob->
nrows);
105 arg->ob_type->tp_free(
arg);
154 PyList_SET_ITEM(
list,
i, PyLong_FromLong(attr->atttypid));
180 PyList_SET_ITEM(
list,
i, PyLong_FromLong(attr->atttypmod));
191 Py_INCREF(ob->
nrows);
209 return PyList_Size(ob->
rows);
218 rv = PyList_GetItem(ob->
rows,
idx);
229 return PyUnicode_FromFormat(
"<%s status=%S nrows=%S rows=%S>",
230 Py_TYPE(ob)->tp_name,
241 return PyObject_GetItem(ob->
rows, item);
249 return PyObject_SetItem(ob->
rows, item,
value);
Datum idx(PG_FUNCTION_ARGS)
FormData_pg_attribute * Form_pg_attribute
void PLy_exception_set(PyObject *exc, const char *fmt,...)
static PyObject * PLy_result_str(PyObject *arg)
static PyObject * PLy_result_item(PyObject *arg, Py_ssize_t idx)
static PyObject * PLy_result_nrows(PyObject *self, PyObject *args)
PyObject * PLy_result_new(void)
void PLy_result_init_type(void)
static void PLy_result_dealloc(PyObject *arg)
static PyTypeObject PLy_ResultType
static PyObject * PLy_result_coltypmods(PyObject *self, PyObject *unused)
static char PLy_result_doc[]
static PyObject * PLy_result_status(PyObject *self, PyObject *args)
static PyObject * PLy_result_subscript(PyObject *arg, PyObject *item)
static Py_ssize_t PLy_result_length(PyObject *arg)
static PyObject * PLy_result_coltypes(PyObject *self, PyObject *unused)
static PyMappingMethods PLy_result_as_mapping
static PyObject * PLy_result_colnames(PyObject *self, PyObject *unused)
static PySequenceMethods PLy_result_as_sequence
static PyMethodDef PLy_result_methods[]
static int PLy_result_ass_subscript(PyObject *arg, PyObject *item, PyObject *value)
struct PLyResultObject PLyResultObject
PyObject * PLyUnicode_FromString(const char *s)
PyObject_HEAD PyObject * nrows
void FreeTupleDesc(TupleDesc tupdesc)
#define TupleDescAttr(tupdesc, i)