pgsql: plpython: Clean up PyModule_AddObject() uses

Started by Peter Eisentraut6 months ago1 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

plpython: Clean up PyModule_AddObject() uses

The comments "PyModule_AddObject does not add a refcount to the
object, for some odd reason" seem distracting. Arguably, this
behavior is expected, not odd. Also, the additional references
created by the existing code are apparently not necessary. But we
should clean up the reference in the error case, as suggested by the
Python documentation.

Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com>
Reviewed-by: li carol <carol.li2025@outlook.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Discussion: /messages/by-id/f31333f1-fbb7-4098-b209-bf2d71fbd4f3@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/34d8111c3abe97daea014f5587f405cde00d9e48

Modified Files
--------------
src/pl/plpython/plpy_plpymodule.c | 43 ++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 21 deletions(-)