Re: plpythonu: how to catch plpy.execute() exceptions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sergey Konoplev <gray.ru@xxxxxxxxx> writes:
> On 29 October 2010 17:02, Dragos Valentin Moinescu
> <dragos.moinescu@xxxxxxxxx> wrote:
>> The thing is that I cannot catch the exception raised by plpy.execute().

> I came to this plpython function template. It handles errors properly
> and works faster then usual function because of the code caching.

Really?  As far as I can see, it's entirely impossible for a plpython
function to trap and recover from an error in plpy.execute.  It can
continue to run plain python code, but it won't be allowed to call
plpy.execute again, and the error will be rethrown when control exits
the function.  There's no way to fix that short of setting up
subtransactions, which is what the other PLs do.

			regards, tom lane

-- 
Sent via pgsql-admin mailing list (pgsql-admin@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux