Re: No return from trigger function - Mailing list pgsql-general

From Simon Riggs
Subject Re: No return from trigger function
Date
Msg-id 1239534066.16396.54.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: No return from trigger function  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wed, 2009-04-08 at 16:06 -0400, Tom Lane wrote:
> "James B. Byrne" <byrnejb@harte-lyne.ca> writes:
> > I just need another set of eyes to see whatever it is that I am
> > overlooking.
>
> The RETURN is inside the EXCEPTION clause.
>
> You really need two BEGINs here, one for the outer function body and
> one for the exception block around the INSERT.

Many people find it surprising that PL/pgSQL allows this occur. It would
be good to have a TODO item relating to improved checking of PL/pgSQL
functions to avoid runtime errors.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support


pgsql-general by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Querying a Large Partitioned DB
Next
From: Alban Hertroys
Date:
Subject: Re: Connect without specifying a database?