pl/python tracebacks - Mailing list pgsql-hackers

From Jan Urbański
Subject pl/python tracebacks
Date
Msg-id 4D1354F3.2090701@wulczer.org
Whole thread Raw
Responses Re: pl/python tracebacks  (Jan Urbański <wulczer@wulczer.org>)
Re: pl/python tracebacks  (Peter Eisentraut <peter_e@gmx.net>)
List 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

pgsql-hackers by date:

Previous
From: Jan Urbański
Date:
Subject: pl/python invalidate functions with composite arguments
Next
From: Jan Urbański
Date:
Subject: pl/python table functions