Re: SQLSTATE and SQLERRM

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
Cc: pgsql-patches(at)postgresql(dot)org, neilc(at)samurai(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: SQLSTATE and SQLERRM
Date: 2005-06-07 16:47:21
Message-ID: 200506071647.j57GlLh26884@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Pavel Stehule wrote:
> Hello
>
> This patch respect last Tom's Lane notes. Is based on first variante,
>
> http://archives.postgresql.org/pgsql-committers/2005-05/msg00303.php
>
> SQLSTATE and SQLERRM are local variables blocks with EXCEPTION clause.
> I wonted respect a litlle bit Oracle behavior and therefore exist these
> variables on function scope too, allways "00000" and "Successful
> completation" (allways marked isconst).
>
> I am really not sure what is better, respect Oracle or not with visibility
> SQLSTATE and SQLERRM on function scope. Is true, using these variables
> outside EXCEPTION is nonsens, but on other hand all magic variables has
> function scope: FOUND, NEW, OLD, ... . SQLSTATE and SQLERRM are little bit
> similar. If are you in oportunity, please correct this patch. It's easy.
> Clean all parts with these on functions related procedures. Then is
> neccesery change documentation, add info about outside exceptions blocks
> is impossible use SQLSTATE and SQLERRM variables. (regress too)

Seems OK to allow them to be visible outside an exception.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-06-07 16:51:22 Re: SQLSTATE and SQLERRM
Previous Message Bruce Momjian 2005-06-07 16:12:37 Re: using strxfrm for having multi locale/please vote for