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