Re: pl/python improvements

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема Re: pl/python improvements
Дата
Msg-id AANLkTikGx9XT6XgV8DDuvm4mnoFjx3a3ZzY0Hn_fL7YJ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pl/python improvements  (Jan Urbański <wulczer@wulczer.org>)
Ответы Re: pl/python improvements  (Jan Urbański <wulczer@wulczer.org>)
Список pgsql-hackers
On Thu, Dec 23, 2010 at 04:08, Jan Urbański <wulczer@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


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Streaming replication as a separate permissions
Следующее
От: Jan Urbański
Дата:
Сообщение: Re: pl/python improvements