Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL
Stephen Frost <sfrost@snowman.net>
Add GET DIAGNOSTICS ... PG_CONTEXT in PL/PgSQL This adds the ability to get the call stack as a string from within a PL/PgSQL function, which can be handy for logging to a table, or to include in a useful message to an end-user. Pavel Stehule, reviewed by Rushabh Lathia and rather heavily whacked around by Stephen Frost.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/plpgsql.sgml | modified | +57 −0 |
| src/backend/utils/error/elog.c | modified | +69 −0 |
| src/include/utils/elog.h | modified | +2 −0 |
| src/pl/plpgsql/src/pl_exec.c | modified | +10 −0 |
| src/pl/plpgsql/src/pl_funcs.c | modified | +2 −0 |
| src/pl/plpgsql/src/pl_gram.y | modified | +6 −0 |
| src/pl/plpgsql/src/plpgsql.h | modified | +1 −0 |
| src/pl/plpgsql/src/pl_scanner.c | modified | +1 −0 |
| src/test/regress/expected/plpgsql.out | modified | +48 −0 |
| src/test/regress/sql/plpgsql.sql | modified | +33 −0 |