Re: why does plperl cache functions using just a bool for is_trigger

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hannu Krosing <hannu@2ndQuadrant.com>
Cc: Jan Urbański <wulczer@wulczer.org>, Alex Hunsaker <badalex@gmail.com>, Andrew Dunstan <andrew@dunslane.net>, Postgres - Hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-04T13:49:41Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Remove unnecessary use of trigger flag to hash plperl functions

Hannu Krosing <hannu@2ndQuadrant.com> writes:
> Are you sure that having each try/except use a subtransaction is the
> right way to do it ?

Actually it is not: what you have to do is use a subtransaction in the
plpy.execute() operation, so that if the called SQL operation fails, you
can clean it up and then report the error to Python as if it were any
other Python error.  Messing with the host language's exception handling
is a sure route to misery.  plperl and pltcl both contain examples of
doing this properly.

			regards, tom lane