1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add pg_trigger_depth() function

This reports the depth level of triggers currently in execution, or zero
if not called from inside a trigger.

No catversion bump in this patch, but you have to initdb if you want
access to the new function.

Author: Kevin Grittner
This commit is contained in:
Alvaro Herrera
2012-01-25 13:15:29 -03:00
parent 6d5aae7afa
commit 74ab96a45e
6 changed files with 213 additions and 1 deletions

View File

@ -12794,6 +12794,13 @@ postgres=# SELECT * FROM unnest2(ARRAY[[1,2],[3,4]]);
<entry>server start time</entry>
</row>
<row>
<entry><literal><function>pg_trigger_depth()</function></literal></entry>
<entry><type>int</type></entry>
<entry>current nesting level of <productname>PostgreSQL</> triggers
(0 if not called, directly or indirectly, from inside a trigger)</entry>
</row>
<row>
<entry><literal><function>session_user</function></literal></entry>
<entry><type>name</type></entry>