24 for (i = 0; i < count; i++)
28 key = PyString_FromStringAndSize(
HSTORE_KEY(entries, base, i),
31 PyDict_SetItem(dict, key, Py_None);
36 value = PyString_FromStringAndSize(
HSTORE_VAL(entries, base, i),
38 PyDict_SetItem(dict, key, value);
54 volatile PyObject *items_v =
NULL;
59 if (!PyMapping_Check(dict))
61 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
62 errmsg(
"not a Python mapping")));
64 pcount = PyMapping_Size(dict);
65 items_v = PyMapping_Items(dict);
72 PyObject *items = (PyObject *) items_v;
74 pairs =
palloc(pcount *
sizeof(*pairs));
76 for (i = 0; i < pcount; i++)
82 tuple = PyList_GetItem(items, i);
83 key = PyTuple_GetItem(tuple, 0);
84 value = PyTuple_GetItem(tuple, 1);
#define PG_RETURN_POINTER(x)
size_t hstoreCheckValLen(size_t len)
#define PointerGetDatum(X)
#define HSTORE_KEYLEN(arr_, i_)
int errcode(int sqlerrcode)
#define HSTORE_VALLEN(arr_, i_)
#define PG_GETARG_POINTER(n)
size_t hstoreCheckKeyLen(size_t len)
#define HSTORE_VALISNULL(arr_, i_)
char * PLyObject_AsString(PyObject *plrv)
#define HSTORE_KEY(arr_, str_, i_)
#define ereport(elevel, rest)
HStore * hstorePairs(Pairs *pairs, int32 pcount, int32 buflen)
Datum plpython_to_hstore(PG_FUNCTION_ARGS)
Datum hstore_to_plpython(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(hstore_to_plpython)
#define HSTORE_VAL(arr_, str_, i_)
int errmsg(const char *fmt,...)
int hstoreUniquePairs(Pairs *a, int32 l, int32 *buflen)