aboutsummaryrefslogtreecommitdiff
path: root/contrib/jsonb_plpython/jsonb_plpython.c
Commit message (Collapse)AuthorAge
* Avoid Python memory leaks in hstore_plpython and jsonb_plpython.Tom Lane2019-04-06
| | | | | | | | | | | | Fix some places where we might fail to do Py_DECREF() on a Python object (thereby leaking it for the rest of the session). Almost all of the risks were in error-recovery paths, which we don't really expect to hit anyway. Hence, while this is definitely a bug fix, it doesn't quite seem worth back-patching. Nikita Glukhov, Michael Paquier, Tom Lane Discussion: https://postgr.es/m/28053a7d-10d8-fc23-b05c-b4749c873f63@postgrespro.ru
* Fix volatile vs. pointer confusionPeter Eisentraut2019-03-14
| | | | | | | | | | | | | | Variables used after a longjmp() need to be declared volatile. In case of a pointer, it's the pointer itself that needs to be declared volatile, not the pointed-to value. So we need PyObject *volatile items; instead of volatile PyObject *items; /* wrong */ Discussion: https://www.postgresql.org/message-id/flat/f747368d-9e1a-c46a-ac76-3c27da32e8e4%402ndquadrant.com
* Remove redundant allocationPeter Eisentraut2018-10-05
| | | | Author: Nikita Glukhov <n.gluhov@postgrespro.ru>
* Fix memory leak in PLySequence_ToJsonbValue()Alexander Korotkov2018-06-15
| | | | | | | | | | PyObject returned from PySequence_GetItem() is not released. Similar code in PLyMapping_ToJsonbValue() is correct, because according to Python documentation PyList_GetItem() and PyTuple_GetItem() return a borrowed reference while PySequence_GetItem() returns new reference. contrib/jsonb_plpython is new in PostgreSQL 11, no backpatch is needed. Author: Nikita Glukhov Discussion: https://postgr.es/m/6001af16-b242-2527-bc7e-84b8a959163b%40postgrespro.ru
* Prevent NaN in jsonb/plpython transformPeter Eisentraut2018-05-02
| | | | | | | | | | As in e348e7ae5727a6da8678036d748e5c5af7deb6c9 for jsonb/plperl, prevent putting a NaN into a jsonb numeric field. Tests for this had been removed in 6278a2a262b63faaf47eb2371f6bcb5b6e3ff118, but in case they are ever resurrected: This would change the output of the test1nan() function to an error.
* Fix assorted compiler warnings seen in the buildfarm.Tom Lane2018-05-02
| | | | | | | | | | | | | | | | | Failure to use DatumGetFoo/FooGetDatum macros correctly, or at all, causes some warnings about sign conversion. This is just cosmetic at the moment but in principle it's a type violation, so clean up the instances I could find. autoprewarm.c and sharedfileset.c contained code that unportably assumed that pid_t is the same size as int. We've variously dealt with this by casting pid_t to int or to unsigned long for printing purposes; I went with the latter. Fix uninitialized-variable warning in RestoreGUCState. This is a live bug in some sense, but of no great significance given that nobody is very likely to care what "line number" is associated with a GUC that hasn't got a source file recorded.
* Post-feature-freeze pgindent run.Tom Lane2018-04-26
| | | | Discussion: https://postgr.es/m/15719.1523984266@sss.pgh.pa.us
* Transforms for jsonb to PL/PythonPeter Eisentraut2018-03-28
Add a new contrib module jsonb_plpython that provide a transform between jsonb and PL/Python. jsonb values are converted to appropriate Python types such as dicts and lists, and vice versa. Author: Anthony Bykov <a.bykov@postgrespro.ru> Reviewed-by: Aleksander Alekseev <a.alekseev@postgrespro.ru> Reviewed-by: Nikita Glukhov <n.gluhov@postgrespro.ru>