diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-02-25 08:42:25 -0500 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-03-27 11:37:22 -0400 |
commit | 70ec3f1f8f0b753c38a1a582280a02930d7cac5f (patch) | |
tree | 71ea0b916782cb47290374095145ca4eabb90bd7 /src/pl/plpython/plpy_cursorobject.c | |
parent | 090010f2ec9b1f9ac1124dc628b89586f911b641 (diff) | |
download | postgresql-70ec3f1f8f0b753c38a1a582280a02930d7cac5f.tar.gz postgresql-70ec3f1f8f0b753c38a1a582280a02930d7cac5f.zip |
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>
Diffstat (limited to 'src/pl/plpython/plpy_cursorobject.c')
-rw-r--r-- | src/pl/plpython/plpy_cursorobject.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/pl/plpython/plpy_cursorobject.c b/src/pl/plpython/plpy_cursorobject.c index 7bb89921484..18e689f1415 100644 --- a/src/pl/plpython/plpy_cursorobject.c +++ b/src/pl/plpython/plpy_cursorobject.c @@ -25,7 +25,6 @@ static PyObject *PLy_cursor_query(const char *query); -static PyObject *PLy_cursor_plan(PyObject *ob, PyObject *args); static void PLy_cursor_dealloc(PyObject *arg); static PyObject *PLy_cursor_iternext(PyObject *self); static PyObject *PLy_cursor_fetch(PyObject *self, PyObject *args); @@ -160,7 +159,7 @@ PLy_cursor_query(const char *query) return (PyObject *) cursor; } -static PyObject * +PyObject * PLy_cursor_plan(PyObject *ob, PyObject *args) { PLyCursorObject *cursor; |