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

From: Neil Conway <neilc(at)samurai(dot)com>
To: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
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:15:09
Message-ID: 429F146D.6010701@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-patches

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.

As for "what makes the most sense", I like Tom's proposal here:

http://archives.postgresql.org/pgsql-committers/2005-05/msg00311.php

i.e. make SQLSTATE and SQLERRM const variables that are local to
EXCEPTION blocks, and make accessing them outside an EXCEPTION block
yield an error.

Does this sound reasonable to people?

-Neil

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2005-06-02 14:20:35 Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support
Previous Message Michael Meskes 2005-06-02 12:50:31 pgsql: Fixed memory leak in ecpglib by adding some missing free()

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-06-02 14:20:35 Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support
Previous Message Magnus Hagander 2005-06-02 14:02:47 Re: Simplify Win32 Signaling code