summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2017-11-15 10:16:34 -0500
committerAndrew Dunstan <andrew@dunslane.net>2017-11-15 10:16:34 -0500
commitcd8ce3a22c0b48d32ffe6543837ba3bb647ac2b2 (patch)
treea6f39aee1d21d35a7f1902c7714777311687344b /src/include
parentebc189e12259cc28b9a09db000626fea1e2a3ffa (diff)
downloadpostgresql-cd8ce3a22c0b48d32ffe6543837ba3bb647ac2b2.tar.gz
Add hooks for session start and session end
These hooks can be used in loadable modules. A simple test module is included. Discussion: https://postgr.es/m/20170720204733.40f2b7eb.nagata@sraoss.co.jp Fabrízio de Royes Mello and Yugo Nagata Reviewed by Michael Paquier and Aleksandr Parfenov
Diffstat (limited to 'src/include')
-rw-r--r--src/include/tcop/tcopprot.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
index f8c535c91e..9f05bfb4ab 100644
--- a/src/include/tcop/tcopprot.h
+++ b/src/include/tcop/tcopprot.h
@@ -35,6 +35,13 @@ extern PGDLLIMPORT const char *debug_query_string;
extern int max_stack_depth;
extern int PostAuthDelay;
+/* Hook for plugins to get control at start and end of session */
+typedef void (*session_start_hook_type) (void);
+typedef void (*session_end_hook_type) (void);
+
+extern PGDLLIMPORT session_start_hook_type session_start_hook;
+extern PGDLLIMPORT session_end_hook_type session_end_hook;
+
/* GUC-configurable parameters */
typedef enum