From: | Jan Urbański <wulczer(at)wulczer(dot)org> |
---|---|
To: | Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | pl/python tracebacks |
Date: | 2010-12-23 13:56:03 |
Message-ID: | 4D1354F3.2090701@wulczer.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Here's a patch implementing traceback support for PL/Python mentioned in
http://archives.postgresql.org/pgsql-hackers/2010-12/msg01991.php. It's
an incremental patch on top of the plpython-refactor patch sent eariler.
Git branch for this patch:
https://github.com/wulczer/postgres/tree/tracebacks.
It's a variant of
http://archives.postgresql.org/pgsql-patches/2006-02/msg00288.php with a
few more twists.
For errors originating from Python exceptions add the traceback as the
message detail. The patch tries to mimick Python's traceback.py module
behaviour as close as possible, icluding interleaving stack frames with
source code lines in the detail message. Any Python developer should
instantly recognize these kind of error reporting, it looks almost the
same as an error in the interactive Python shell.
A future optimisation might be not splitting the procedure source each
time a traceback is generated, but for now it's probably not the most
important scenario to optimise for.
Cheers,
Jan
Attachment | Content-Type | Size |
---|---|---|
plpython-tracebacks.diff | text/x-patch | 20.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Urbański | 2010-12-23 14:00:04 | pl/python table functions |
Previous Message | Jan Urbański | 2010-12-23 13:50:46 | pl/python invalidate functions with composite arguments |