Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support
Date: 2005-06-02 14:28:33
Message-ID: Pine.LNX.4.44.0506021620340.4622-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-patches

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2005-06-02 14:52:07 Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support
Previous Message Tom Lane 2005-06-02 14:20:35 Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2005-06-02 14:43:28 Re: Oracle date type compat. functions: next_day, last_day,
Previous Message Luke Lonergan 2005-06-02 14:24:28 Re: COPY fast parse patch