Re: proposal: PL/Pythonu - function ereport

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: proposal: PL/Pythonu - function ereport
Дата
Msg-id CAMsr+YH-r-2=E-c7ppO+eX8tcHBxqnHKLRb68GpDAsk7hmcbUg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: proposal: PL/Pythonu - function ereport  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal: PL/Pythonu - function ereport  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: proposal: PL/Pythonu - function ereport  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On 16 October 2015 at 02:47, Pavel Stehule <pavel.stehule@gmail.com> wrote:

>  postgres=# do $$
> x = plpy.SPIError('Nazdarek');
> x.spidata = (100, "Some detail", "some hint", None, None);
> raise x;
> $$ language plpythonu;

Shouldn't that look more like

raise plpy.SPIError(msg="Message", sqlstate="0P001", hint="Turn it on
and off again") ?

Keyword args are very much the norm for this sort of thing. I recall
them being pretty reasonable to deal with in the CPython API too, but
otherwise a trivial Python wrapper in the module can easily adapt the
interface.



-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: [PATCH v3] GSSAPI encryption support
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Parallel Seq Scan