Search Postgresql Archives

Re: PL/pgSQL: EXCEPTION NOSAVEPOINT

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

 



[redirected from -patches]

On Wed, 2005-08-03 at 16:25 -0400, Tom Lane wrote:
> Matt Miller <mattm@xxxxxxx> writes:
> > allow a PL/pgSQL exception to not automatically rollback
> > the work done by the current block.
> 
> This fundamentally breaks the entire backend.  You do not have the
> option to continue processing after elog(ERROR);

Okay, I think I'm beginning to see the naivete of that patch's
simplistic attempt to decouple backend error handling from transaction
management.  But I still haven't found a way to meet my original need:

On Wed, 2005-08-03 at 19:58 +0000, Matt Miller wrote:
> The benefit is that [PL/pgSQL] exception
> handling can be used as a program flow control technique, without
> invoking transaction management mechanisms.  This also adds additional
> means to enhanced Oracle PL/SQL compatibility.

Basically I'd like my Pl/pgSQL code to be able to utilize the try/catch
paradigm of error handling without the overhead of subtransactions and
without the effect of a rollback.  If I catch the exception then
everything should be fine as far as the transaction is concerned.  If
don't catch the exception, or if I re-raise it, then the enclosing block
can decide to rollback.  This is more consistent with Oracle, and I have
hundreds of Oracle procs to convert across multiple databases.

I'm still thinking that some kind of hack to
src/pl/plpgsql/src/pl_exec.c is probably where I'm headed, but I'm open
to consider other approaches/advice.

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux