9 .
name =
"hstore_plpython",
14typedef char *(*PLyObject_AsString_t) (PyObject *plrv);
16typedef PyObject *(*PLyUnicode_FromStringAndSize_t) (
const char *s, Py_ssize_t size);
71#define PLyObject_AsString PLyObject_AsString_p
72#define PLyUnicode_FromStringAndSize PLyUnicode_FromStringAndSize_p
73#define hstoreUpgrade hstoreUpgrade_p
74#define hstoreUniquePairs hstoreUniquePairs_p
75#define hstorePairs hstorePairs_p
76#define hstoreCheckKeyLen hstoreCheckKeyLen_p
77#define hstoreCheckValLen hstoreCheckValLen_p
95 (
errcode(ERRCODE_OUT_OF_MEMORY),
98 for (
i = 0;
i < count;
i++)
105 PyDict_SetItem(dict,
key, Py_None);
128 PyObject *
volatile items;
139 if (PySequence_Check(dict) || !PyMapping_Check(dict))
141 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
142 errmsg(
"not a Python mapping")));
144 pcount = PyMapping_Size(dict);
145 items = PyMapping_Items(dict);
153 pairs =
palloc(pcount *
sizeof(*pairs));
155 for (
i = 0;
i < pcount;
i++)
161 tuple = PyList_GetItem(
items,
i);
162 key = PyTuple_GetItem(tuple, 0);
163 value = PyTuple_GetItem(tuple, 1);
169 if (
value == Py_None)
#define AssertVariableIsOfType(varname, typename)
void * load_external_function(const char *filename, const char *funcname, bool signalNotFound, void **filehandle)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_POINTER(x)
#define HSTORE_KEY(arr_, str_, i_)
#define PG_GETARG_HSTORE_P(x)
#define HSTORE_VALISNULL(arr_, i_)
#define HSTORE_VALLEN(arr_, i_)
#define HSTORE_KEYLEN(arr_, i_)
#define HSTORE_VAL(arr_, str_, i_)
Datum plpython_to_hstore(PG_FUNCTION_ARGS)
#define PLyUnicode_FromStringAndSize
int(* hstoreUniquePairs_t)(Pairs *a, int32 l, int32 *buflen)
static hstoreUpgrade_t hstoreUpgrade_p
static hstoreCheckKeyLen_t hstoreCheckKeyLen_p
HStore *(* hstoreUpgrade_t)(Datum orig)
#define hstoreCheckKeyLen
#define hstoreUniquePairs
PyObject *(* PLyUnicode_FromStringAndSize_t)(const char *s, Py_ssize_t size)
static hstorePairs_t hstorePairs_p
static PLyObject_AsString_t PLyObject_AsString_p
PG_MODULE_MAGIC_EXT(.name="hstore_plpython",.version=PG_VERSION)
Datum hstore_to_plpython(PG_FUNCTION_ARGS)
char *(* PLyObject_AsString_t)(PyObject *plrv)
static hstoreCheckValLen_t hstoreCheckValLen_p
static hstoreUniquePairs_t hstoreUniquePairs_p
size_t(* hstoreCheckValLen_t)(size_t len)
static PLyUnicode_FromStringAndSize_t PLyUnicode_FromStringAndSize_p
#define hstoreCheckValLen
HStore *(* hstorePairs_t)(Pairs *pairs, int32 pcount, int32 buflen)
PG_FUNCTION_INFO_V1(hstore_to_plpython)
size_t(* hstoreCheckKeyLen_t)(size_t len)
#define PLyObject_AsString
static Datum PointerGetDatum(const void *X)