Why doesn't `RAISE EXCEPTION` provide error context? - Mailing list pgsql-general

From Taytay
Subject Why doesn't `RAISE EXCEPTION` provide error context?
Date
Msg-id 1427953375873-5844382.post@n5.nabble.com
Whole thread Raw
Responses Re: Why doesn't `RAISE EXCEPTION` provide error context?
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Would like to know how analyze works technically
Next
From: "David G. Johnston"
Date:
Subject: Re: Why doesn't `RAISE EXCEPTION` provide error context?