summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2012-01-25 13:15:29 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2012-01-25 13:22:54 -0300
commit74ab96a45ef6259aa6a86a781580edea8488511a (patch)
tree92415eea1e32bb33c68b9fdbbdc5c57732d78c68 /src/include
parent6d5aae7afacc564ead2af88c76b13cfc55750556 (diff)
downloadpostgresql-74ab96a45ef6259aa6a86a781580edea8488511a.tar.gz
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
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/pg_proc.h3
-rw-r--r--src/include/commands/trigger.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index b6ac1959cc..ef5ca3047d 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -2698,6 +2698,9 @@ DESCR("statistics: reset collected statistics for a single table or index in the
DATA(insert OID = 3777 ( pg_stat_reset_single_function_counters PGNSP PGUID 12 1 0 0 0 f f f f f v 1 0 2278 "26" _null_ _null_ _null_ _null_ pg_stat_reset_single_function_counters _null_ _null_ _null_ ));
DESCR("statistics: reset collected statistics for a single function in the current database");
+DATA(insert OID = 3163 ( pg_trigger_depth PGNSP PGUID 12 1 0 0 0 f f f t f s 0 0 23 "" _null_ _null_ _null_ _null_ pg_trigger_depth _null_ _null_ _null_ ));
+DESCR("current trigger depth");
+
DATA(insert OID = 3778 ( pg_tablespace_location PGNSP PGUID 12 1 0 0 0 f f f t f s 1 0 25 "26" _null_ _null_ _null_ _null_ pg_tablespace_location _null_ _null_ _null_ ));
DESCR("tablespace location");
diff --git a/src/include/commands/trigger.h b/src/include/commands/trigger.h
index ba0f32464e..93033414d9 100644
--- a/src/include/commands/trigger.h
+++ b/src/include/commands/trigger.h
@@ -205,4 +205,6 @@ extern bool RI_Initial_Check(Trigger *trigger,
extern int RI_FKey_trigger_type(Oid tgfoid);
+extern Datum pg_trigger_depth(PG_FUNCTION_ARGS);
+
#endif /* TRIGGER_H */