On Thu, Dec 23, 2010 at 04:08, Jan Urbański <wulc...@wulczer.org> wrote: > * providing custom exceptions for SPI errors, so you can catch only > UniqueViolations and not have to muck around with SQLCODE
py-postgresql already has a mapping from error codes to Python exceptions. I think it makes sense to re-use that, instead of inventing new names. https://github.com/jwp/py-postgresql/blob/v1.1/postgresql/exceptions.py It also follows the Python convention of ending exception classes with "Error", so instead of UniqueViolation they have UniqueError, instead of InvalidTextRepresentation, they have TextRepresentationError > Meanwhile the code > is available at https://github.com/wulczer/postgres. You will find 10 > branches there, 9 correspond to these features, and the "plpython" > branch is the sum of them all. I tried building the plpython branch, but got an unrelated error. I didn't investigate further for now... make[3]: Entering directory `/home/marti/src/postgresql-py/src/backend/bootstrap' gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -I. -I. -I../../../src/include -D_GNU_SOURCE -c -o bootparse.o bootparse.c bootparse.y: In function ‘boot_yyparse’: bootparse.y:224:16: error: too few arguments to function ‘heap_create’ ../../../src/include/catalog/heap.h:37:17: note: declared here bootparse.y:249:16: error: too few arguments to function ‘heap_create_with_catalog’ ../../../src/include/catalog/heap.h:48:12: note: declared here make[3]: *** [bootparse.o] Error 1 Regards, Marti -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers