MCPcopy Create free account
hub / github.com/apache/cloudberry / PLyUnicode_AsString

Function PLyUnicode_AsString

src/pl/plpython/plpy_util.c:88–96  ·  view source on GitHub ↗

* Convert a Python unicode object to a C string in PostgreSQL server * encoding. No Python object reference is passed out of this * function. The result is palloc'ed. * * Note that this function is disguised as PyString_AsString() when * using Python 3. That function returns a pointer into the internal * memory of the argument, which isn't exactly the interface of this * function. But i

Source from the content-addressed store, hash-verified

86 * reference that you ought to better leave alone.
87 */
88char *
89PLyUnicode_AsString(PyObject *unicode)
90{
91 PyObject *o = PLyUnicode_Bytes(unicode);
92 char *rv = pstrdup(PyBytes_AsString(o));
93
94 Py_XDECREF(o);
95 return rv;
96}
97
98#if PY_MAJOR_VERSION >= 3
99/*

Callers 3

PLy_spi_prepareFunction · 0.85
PLy_exec_triggerFunction · 0.85
PLy_modify_tupleFunction · 0.85

Calls 2

PLyUnicode_BytesFunction · 0.85
pstrdupFunction · 0.50

Tested by

no test coverage detected