-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit introduces two hooks which allow another extension to do something (and return) immediately after `set_user` and `reset_user` are called. There is a new make target, `make install-headers`, which is responsible for exposing the hook to other extensions. The target is prepended to the `install` target by default. To use the post-set_user hooks in an extension: 1) Add '-I$(includedir)' to CPPFLAGS 2) #include set_user.h in whichever file implements the hook 3) Register the 'post_reset_user_hook' and 'post_set_user_hook' with a local implementation
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef SET_USER_H | ||
#define SET_USER_H | ||
|
||
/* Expose a hook for other extensions to use after reset_user finishes up. */ | ||
typedef void (*post_reset_user_hook_type) (void); | ||
extern PGDLLIMPORT post_reset_user_hook_type post_reset_user_hook; | ||
|
||
/* Expose a hook for other extensions to use after set_user finishes up. */ | ||
typedef void (*post_set_user_hook_type) (const char *username); | ||
extern PGDLLIMPORT post_set_user_hook_type post_set_user_hook; | ||
#endif |