Why doesn't `RAISE EXCEPTION` provide error context?

Поиск
Список
Период
Сортировка
От Taytay
Тема Why doesn't `RAISE EXCEPTION` provide error context?
Дата
Msg-id 1427953375873-5844382.post@n5.nabble.com
обсуждение исходный текст
Ответы Re: Why doesn't `RAISE EXCEPTION` provide error context?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
We make heavy use of `GET STACKED DIAGNOSTICS` to determine where errors
happened.
However, I am trying to use RAISE EXCEPTION to report errors, and have
discovered that RAISE is specifically prevented from adding to the error
context:



So that means that this doesn't work:



I've posted more details here:
http://dba.stackexchange.com/questions/96743/postgres-how-to-get-stack-trace-for-a-manually-raised-exception

That context would be awfully useful for us, even for manually generated
exceptions.
Can anyone shed some light on A) why this is, and B) if it's still desired,
and C) if so, are there any workarounds? Is there an exception I can trick
Postgres into throwing that will include my user-generated string?

Many thanks for any help you can offer.




--
View this message in context:
http://postgresql.nabble.com/Why-doesn-t-RAISE-EXCEPTION-provide-error-context-tp5844382.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Would like to know how analyze works technically
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Why doesn't `RAISE EXCEPTION` provide error context?