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

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support
Дата
Msg-id 429F146D.6010701@samurai.com
обсуждение исходный текст
Ответ на Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Ответы Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support
Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support
Список pgsql-committers
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

В списке pgsql-committers по дате отправления:

Предыдущее
От: meskes@svr1.postgresql.org (Michael Meskes)
Дата:
Сообщение: pgsql: Fixed memory leak in ecpglib by adding some missing free()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support