On 9/25/19 10:44 PM, Thiemo Kellner wrote:
Hello Adrian

Quoting Adrian Klaver <adrian.kla...@aklaver.com>:

To get above I believe you will need to use GET CURRENT DIAGNOSTICS PG_CONTEXT:

I actually use "get stacked diagnostics" to retrieve the exception place. And it works. I am not sure why I did no see it.

GET [ CURRENT ] DIAGNOSTICS:
https://www.postgresql.org/docs/11/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS

and

GET STACKED DIAGNOSTICS

https://www.postgresql.org/docs/11/plpgsql-control-structures.html#PLPGSQL-EXCEPTION-DIAGNOSTICS

are two different things.

See the example here:

https://www.postgresql.org/docs/11/plpgsql-control-structures.html#PLPGSQL-CALL-STACK


However, I noticed, that the stack does not include the error place in dynamic SQL executed by the "execute" command. Maybe I am missing something again.

Kind regards

Thiemo



--
Adrian Klaver
adrian.kla...@aklaver.com


Reply via email to