11 typedef char *(*PLyObject_AsString_t) (PyObject *plrv);
13 typedef PyObject *(*PLyUnicode_FromStringAndSize_t) (
const char *s, Py_ssize_t
size);
68 #define PLyObject_AsString PLyObject_AsString_p
69 #define PLyUnicode_FromStringAndSize PLyUnicode_FromStringAndSize_p
70 #define hstoreUpgrade hstoreUpgrade_p
71 #define hstoreUniquePairs hstoreUniquePairs_p
72 #define hstorePairs hstorePairs_p
73 #define hstoreCheckKeyLen hstoreCheckKeyLen_p
74 #define hstoreCheckValLen hstoreCheckValLen_p
92 (
errcode(ERRCODE_OUT_OF_MEMORY),
95 for (
i = 0;
i < count;
i++)
102 PyDict_SetItem(dict,
key, Py_None);
125 PyObject *
volatile items;
136 if (PySequence_Check(dict) || !PyMapping_Check(dict))
138 (
errcode(ERRCODE_WRONG_OBJECT_TYPE),
139 errmsg(
"not a Python mapping")));
141 pcount = PyMapping_Size(dict);
142 items = PyMapping_Items(dict);
150 pairs =
palloc(pcount *
sizeof(*pairs));
152 for (
i = 0;
i < pcount;
i++)
158 tuple = PyList_GetItem(
items,
i);
159 key = PyTuple_GetItem(tuple, 0);
160 value = PyTuple_GetItem(tuple, 1);
166 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_)
HStore *(* hstoreUpgrade_t)(Datum orig)
Datum plpython_to_hstore(PG_FUNCTION_ARGS)
#define PLyUnicode_FromStringAndSize
int(* hstoreUniquePairs_t)(Pairs *a, int32 l, int32 *buflen)
static hstoreUpgrade_t hstoreUpgrade_p
char *(* PLyObject_AsString_t)(PyObject *plrv)
static hstoreCheckKeyLen_t hstoreCheckKeyLen_p
#define hstoreCheckKeyLen
PyObject *(* PLyUnicode_FromStringAndSize_t)(const char *s, Py_ssize_t size)
#define hstoreUniquePairs
HStore *(* hstorePairs_t)(Pairs *pairs, int32 pcount, int32 buflen)
static hstorePairs_t hstorePairs_p
static PLyObject_AsString_t PLyObject_AsString_p
Datum hstore_to_plpython(PG_FUNCTION_ARGS)
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
PG_FUNCTION_INFO_V1(hstore_to_plpython)
size_t(* hstoreCheckKeyLen_t)(size_t len)
#define PLyObject_AsString
static Datum PointerGetDatum(const void *X)
static pg_noinline void Size size