New answers tagged error-handling
You can work around this restriction and make plpgsql emit error context as desired by calling another function that raises (warning, notice, ...) the error for you. I posted a solution for that a couple of years back - in one of my first posts here on dba.SE: -- helper function to raise an exception with CONTEXT CREATE OR REPLACE FUNCTION f_raise(_lvl ...
This behaviour appears to be by design. In src/pl/plpgsql/src/pl_exec.c the error context callback explicitly checks to see if it's being called in the context of a PL/PgSQL RAISE statement and, if so, skips emitting the error context: /* * error context callback to let us supply a call-stack traceback */ static void plpgsql_exec_error_callback(void ...
Check MS documentation. Specifically the top line: The THROW statement honors SET XACT_ABORT RAISERROR does not. New Applications should use THROW instead of RAISERROR. I believe that is your problem, right there. https://msdn.microsoft.com/en-us/library/ms188792.aspx
Top 50 recent answers are included