Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support which sets these values

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support which sets these values
Дата
Msg-id 27289.1117116650@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support which sets these values  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support which sets these values
Список pgsql-committers
Peter Eisentraut <peter_e@gmx.net> writes:
> Does Oracle support GET DIAGNOSTICS?  If so, couldn't we just use that?
> I can't see what good will become of making any slightly useful
> information become available as magic variables of some kind.

Oracle actually defines these things as parameterless functions that are
called without parentheses (like CURRENT_USER).  "Magic variables" are
about as close as we can get to matching that.

If we go with the idea that they should be local to blocks containing
EXCEPTION, then the easiest implementation would involve pushing them
into the namespace at the beginning of processing the EXCEPTION clause;
which'd mean they are actually physically inaccessible anywhere outside
EXCEPTION.  That seems like a suitably narrow API --- in fact it
completely gets rid of the question of what their initial/default values
should be.  I think we can mark 'em CONST, too, so that they are truly
semantically indistinguishable from functions.

            regards, tom lane

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support which sets these values
Следующее
От: momjian@svr1.postgresql.org (Bruce Momjian)
Дата:
Сообщение: pgsql: Back out: Display only 9 not 10 digits of precision for