pgsql: PL/Python: Add cursor and execute methods to plan object

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: PL/Python: Add cursor and execute methods to plan object
Date: 2017-03-27 15:39:19
Message-ID: E1csWjn-0007qh-TC@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)dunstan(at)2ndquadrant(dot)com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/70ec3f1f8f0b753c38a1a582280a02930d7cac5f

Modified Files
--------------
doc/src/sgml/plpython.sgml | 14 ++++++++++++--
src/pl/plpython/expected/plpython_spi.out | 19 ++++++++++++++++---
src/pl/plpython/plpy_cursorobject.c | 3 +--
src/pl/plpython/plpy_cursorobject.h | 1 +
src/pl/plpython/plpy_planobject.c | 31 +++++++++++++++++++++++++++++++
src/pl/plpython/plpy_spi.c | 3 +--
src/pl/plpython/plpy_spi.h | 1 +
src/pl/plpython/sql/plpython_spi.sql | 18 ++++++++++++++++--
8 files changed, 79 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2017-03-27 15:43:59 pgsql: Rework the stats_ext test
Previous Message Teodor Sigaev 2017-03-27 15:35:29 pgsql: Improve performance of find_tabstat_entry()/get_tabstat_entry()