exception handling support in pgSQL

From: Paramveer(dot)Singh(at)trilogy(dot)com
To: "pgSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: exception handling support in pgSQL
Date: 2004-08-15 05:57:09
Message-ID: OFE1CE4BDB.EF7681D4-ONE5256EF1.001A9767@trilogy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!
I am a developer working for a company which typically deploys apps on
Oracle.
We would like to move to postgres for obvious reasons.
However, most of  our legacy apps use the exception handling support
provided by PL/SQL.

Instead of porting each of these procedures by hand,
we would like to add exception handling support to pgSQL if possible.

I looked into the code for the pgSQL library, and as I understand it,
we can put support for user defined exceptions (something we use a lot)
within the pgSQL library by intercepting the
pgSQL call to SPI and moving to the handler locally.

However, it seems that for system level exceptions (like zero_divide) we
would have to go into SPI where it is executing the query plan.
Is this correct? or can we put the support for these in the library itself
somehow?

If we have to make changes in SPI (or even pgSQL), would the postgres
community be interested in accepting these changes into the core?

Finally, I was trying to understand the code for the library itself, and it
seems to use a namespace stack. Is this stack used for variable scope
resolution?
Exceptions (user defined) would also require scope resolution. Therefore,
would we have to implement it within this stack ? or can we put in another
stack for the exception resolution?

thanks
paraM

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2004-08-15 05:58:52 Re: [ADMIN] SRPM for 8.0.0 beta?
Previous Message Joe Conway 2004-08-15 05:51:22 Re: SRPM for 8.0.0 beta?