Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support - Mailing list pgsql-committers

From Pavel Stehule
Subject Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support
Date
Msg-id Pine.LNX.4.44.0506021620340.4622-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support  (Neil Conway <neilc@samurai.com>)
List pgsql-committers
On Fri, 3 Jun 2005, Neil Conway wrote:

> Pavel Stehule wrote:
> > So we can have only one procedure level scope variable, which is
> > initialized on start of exception and zeroized on the end of exception
> > block. This behavior is different from my patch, but is better for Oracle
> > compatibility and I prefere its.
>
> I should have commented on this earlier: I don't think exact Oracle
> compatibility is _at all_ important. This feature won't be bug-for-bug
> compatible with Oracle in any case (e.g. SQLSTATE vs. SQLERRM) -- I
> think we should implement what makes the most sense, as long as it
> provides functionality more or less equivalent to what Oracle does.
>

Oracle behavior ~ when control go out from any exception protected block
then reset SQLSTATE. Tom's proposal is more logic, but needs much more
changes in parser. And there is one possible incompatibility - Oracle
documentation clearly speeks so SQLSTATE is outside EXCEPTION BLOCK
visible and has value 00000.

I din't find easy way how append variable only when block contains
EXCEPTION part. I wilcome any advice

Pavel


pgsql-committers by date:

Previous
From: llonergan@pgfoundry.org (User Llonergan)
Date:
Subject: bizgres - bizgres: compiler files removed.
Next
From: Pavel Stehule
Date:
Subject: Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support