Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
Cc: Jan Urbański <wulczer(at)wulczer(dot)org>, Alex Hunsaker <badalex(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: why does plperl cache functions using just a bool for is_trigger
Date: 2010-11-04 13:49:41
Message-ID: 4262.1288878581@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Hannu Krosing <hannu(at)2ndQuadrant(dot)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

In response to

pgsql-hackers by date

Next:From: KaiGai KoheiDate: 2010-11-04 13:55:15
Subject: Re: contrib: auth_delay module
Previous:From: Stephen FrostDate: 2010-11-04 13:35:16
Subject: Re: contrib: auth_delay module

Privacy Policy | About PostgreSQL
Copyright © 1996-2013 The PostgreSQL Global Development Group