login_hook is an extension enabling execution of a custom function following a user login.
login_hook relies on the extension being included in the
session_preload_libraries configuration parameter, so that its
_PG_init() function is executed on login. This calls a user-defined function, which must be named
login_hook.login(). If the extension (more specifically its schema) is not present, no action will be taken.
Careful consideration is needed before deploying this solution in a production environment.