aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpy_resultobject.c
Commit message (Collapse)AuthorAge
* Use C99 designated initializers for some structsPeter Eisentraut2018-09-07
| | | | | | | These are just a few particularly egregious cases that were hard to read and write, and error prone because of many similar adjacent types. Discussion: https://www.postgresql.org/message-id/flat/4c9f01be-9245-2148-b569-61a8562ef190%402ndquadrant.com
* PL/Python: Remove use of simple slicing APIPeter Eisentraut2018-09-05
| | | | | | | | | | The simple slicing API (sq_slice, sq_ass_slice) has been deprecated since Python 2.0 and has been removed altogether in Python 3, so remove those functions from the PLyResult class. Instead, the non-slice mapping functions mp_subscript and mp_ass_subscript can take slice objects as an index. Since we just pass the index through to the underlying list object, we already support that. Test coverage was already in place.
* Consistently catch errors from Python _New() functionsPeter Eisentraut2017-11-18
| | | | | | | | | | | | Python Py*_New() functions can fail and return NULL in out-of-memory conditions. The previous code handled that inconsistently or not at all. This change organizes that better. If we are in a function that is called from Python, we just check for failure and return NULL ourselves, which will cause any exception information to be passed up. If we are called from PostgreSQL, we consistently create an "out of memory" error. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
* Change tupledesc->attrs[n] to TupleDescAttr(tupledesc, n).Andres Freund2017-08-20
| | | | | | | | | | | This is a mechanical change in preparation for a later commit that will change the layout of TupleDesc. Introducing a macro to abstract the details of where attributes are stored will allow us to change that in separate step and revise it in future. Author: Thomas Munro, editorialized by Andres Freund Reviewed-By: Andres Freund Discussion: https://postgr.es/m/CAEepm=0ZtQ-SpsgCyzzYpsXS6e=kZWqk3g5Ygn3MDV7A8dabUA@mail.gmail.com
* PL/Python: Add result object str handlerPeter Eisentraut2013-02-03
| | | | | | | This is intended so that say plpy.debug(rv) prints something useful for debugging query execution results. reviewed by Steve Singer
* Fix typoPeter Eisentraut2013-01-07
|
* PL/Python: Remove PLy_result_ass_itemPeter Eisentraut2012-07-17
| | | | | | It is apparently no longer used after the new slicing support was implemented (a97207b6908f1d4a7d19b37b818367bb0171039f), so let's remove the dead code and see if anything cares.
* Run pgindent on 9.2 source tree in preparation for first 9.3Bruce Momjian2012-06-10
| | | | commit-fest.
* PL/Python: Fix slicing support for result objects for Python 3Peter Eisentraut2012-05-10
| | | | | | | | | | The old way of implementing slicing support by implementing PySequenceMethods.sq_slice no longer works in Python 3. You now have to implement PyMappingMethods.mp_subscript. Do this by simply proxying the call to the wrapped list of result dictionaries. Consolidate some of the subscripting regression tests. Jan Urbański
* PL/Python: Fix crash when colnames() etc. called without result setPeter Eisentraut2012-04-15
| | | | | | | | The result object methods colnames() etc. would crash when called after a command that did not produce a result set. Now they throw an exception. discovery and initial patch by Jean-Baptiste Quenot
* PL/Python: Add result metadata functionsPeter Eisentraut2012-01-30
| | | | | | | | Add result object functions .colnames, .coltypes, .coltypmods to obtain information about the result column names and types, which was previously not possible in the PL/Python SPI interface. reviewed by Abhijit Menon-Sen
* PL/Python: Add argument names to function declarationsPeter Eisentraut2011-12-29
| | | | For easier source reading
* Split plpython.c into smaller piecesPeter Eisentraut2011-12-18
This moves the code around from one huge file into hopefully logical and more manageable modules. For the most part, the code itself was not touched, except: PLy_function_handler and PLy_trigger_handler were renamed to PLy_exec_function and PLy_exec_trigger, because they were not actually handlers in the PL handler sense, and it makes the naming more similar to the way PL/pgSQL is organized. The initialization of the procedure caches was separated into a new function init_procedure_caches to keep the hash tables private to plpy_procedures.c. Jan Urbański and Peter Eisentraut