Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support (Really Oracle behavior) - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support (Really Oracle behavior)
Date
Msg-id 2717.1117122051@sss.pgh.pa.us
Whole thread Raw
Responses Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
List pgsql-committers
Pavel Stehule <stehule@kix.fsv.cvut.cz> writes:
> What it is mean?

I think it means Oracle is broken ;-)

> 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.

That might be taking the notion of bug-compatibility with PL/SQL
a bit too far.  For that matter, did you check whether Oracle
actually treats it as a procedure-scope variable?  Try having the
exception block call another function and trap an error inside that.
Does SQLCODE change in the calling function?

            regards, tom lane

pgsql-committers by date:

Previous
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Back out: Display only 9 not 10 digits of precision for
Next
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Use Abs() macro to replace ? :.