]> granicus.if.org Git - postgresql/commit
PL/Python: Add cursor and execute methods to plan object
authorPeter Eisentraut <peter_e@gmx.net>
Sat, 25 Feb 2017 13:42:25 +0000 (08:42 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 27 Mar 2017 15:37:22 +0000 (11:37 -0400)
commit70ec3f1f8f0b753c38a1a582280a02930d7cac5f
tree71ea0b916782cb47290374095145ca4eabb90bd7
parent090010f2ec9b1f9ac1124dc628b89586f911b641
PL/Python: Add cursor and execute methods to plan object

Instead of

    plan = plpy.prepare(...)
    res = plpy.execute(plan, ...)

you can now write

    plan = plpy.prepare(...)
    res = plan.execute(...)

or even

    res = plpy.prepare(...).execute(...)

and similarly for the cursor() method.

This is more in object oriented style, and makes the hybrid nature of
the existing execute() function less confusing.

Reviewed-by: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
doc/src/sgml/plpython.sgml
src/pl/plpython/expected/plpython_spi.out
src/pl/plpython/plpy_cursorobject.c
src/pl/plpython/plpy_cursorobject.h
src/pl/plpython/plpy_planobject.c
src/pl/plpython/plpy_spi.c
src/pl/plpython/plpy_spi.h
src/pl/plpython/sql/plpython_spi.sql