still a wip, plpython3 - Mailing list pgsql-hackers

From James Pye
Subject still a wip, plpython3
Date
Msg-id C0673B6A-BF7C-4AB3-A8D0-E713F11A5805@jwp.name
Whole thread Raw
List pgsql-hackers
Thought another message might be appropriate as I've made some  
progress: finished up PEP302 interfaces on PyPgFunction  
objects(provides linecache support for tracebacks), IST support, DB  
error handling(pg error -> pyexc -> pg error), and, recently, some  
annoying type interface improvements..

Some of those features in action: IST tests[1], error tests[2]. Also,  
I started on a WIP wiki page covering my progress and a small amount  
of documentation for anyone curious enough to play with it[3].


[some notes; feel free to swing the cluebat =]

In order to implement IST support and error handling, the PL has to  
keep track of the number of open ISTs, and whether or not the code  
executed by the PL caused a database error.

Tracking the error state is needed so that some (most) Postgres  
interfaces will not be invoked inside a failed transaction, and so  
that the PL will not exit without indicating an error state(elog/ 
ereport), and so that the PL will not try to commit a failed  
subtransaction on IST __exit__.

Tracking the number of open ISTs is needed so that the PL can properly  
clean up after any misused Postgres.Transaction objects. When this  
situation is presented to the PL, all the excess ISTs that remained  
open will be aborted and an error will be thrown.


At this point, the major items remaining are: SPI interfaces,  
polymorphic functions, array & composite interfaces(the objects can be  
created and passed around, but the item/element access methods are  
completely untested, ATM), whatever random bugs popup/minor cleanupS,  
and, of course, documentation. Still lots to do.



[1]
http://github.com/jwp/postgresql-plpython3/blob/67c75e7e80c853d12cd279ecd86fd0a409d4007d/src/pl/plpython3/expected/plpython3_xact.out

[2]
http://github.com/jwp/postgresql-plpython3/blob/67c75e7e80c853d12cd279ecd86fd0a409d4007d/src/pl/plpython3/expected/plpython3_error.out

[3] http://wiki.postgresql.org/wiki/WIP:plpython3


pgsql-hackers by date:

Previous
From: "simon@2ndquadrant.com"
Date:
Subject: Re: Lazy Snapshots
Next
From: Josh Berkus
Date:
Subject: Re: Feedback about Drupal SQL debugging