[HACKERS] PL/Python: Add cursor and execute methods to plan object

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема [HACKERS] PL/Python: Add cursor and execute methods to plan object
Дата
Msg-id 8b46d680-47ef-f48d-93ff-16aac47f69c9@2ndquadrant.com
обсуждение исходный текст
Ответы Re: [HACKERS] PL/Python: Add cursor and execute methods to plan object  (David Steele <david@pgmasters.net>)
Re: [HACKERS] PL/Python: Add cursor and execute methods to planobject  (Jim Nasby <jim@nasby.net>)
Список pgsql-hackers
Something that has been bothering me in PL/Python for a long time is the
non-object-oriented way in which plans are prepared and executed:

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

where plpy.execute() takes either a plan or a query string.

I think a better style would be

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

so that the "plan" is more like a statement handle that one finds in
other APIs.

This ended up being very easy to implement, so I'm proposing to allow
this new syntax as an alternative.

I came across this again as I was developing the background sessions API
for PL/Python.  So I'm also wondering here which style people prefer so
I can implement it there.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: [HACKERS] I propose killing PL/Tcl's "modules" infrastructure
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] btree_gin and btree_gist for enums