{"repo":"splendiddata/login_hook","free":true,"listed":false,"github":"https://github.com/splendiddata/login_hook","clone":"git clone https://github.com/splendiddata/login_hook.git","description":"Postgres database extension to mimic a logon trigger","language":"PLpgSQL","stars":33,"topics":["postgresql","postgresql-extension","logon-trigger","postgres"],"license":"GPL-3.0","category":"databases-storage","readme_excerpt":"login hook Postgres database extension to execute some code on user login, comparable to Oracle's after logon trigger. Postgres versions The login hook database extension works well in Postgres versions 13, 14, 15 and 16. Postgres version 17 works as well BUT please start using the login event trigger instead. For an example see https://www.postgresql.org/docs/17/event-trigger-database-login-example.html. To allow for a smooth migration to the Postgres native login even trigger: As soon as a login event trigger is defined in the database, the login hook.login() function will no longer be executed. Later you can drop the login hook extension and remove the login hook.login() function. Maintenance of the login hook will be discontinued after Postgres version 19. Installation First you'll need to compile the database extension (Check the Postgres manual for more information): - Make sure pg config points to the right places - execute: make - execute: sudo make install After compilation, the login hook.so library must be set to load at session start. So please alter the postgresql.conf file and add the login\\ hook.so library to the session\\ preload\\ libraries setting. For example: Restart the database to activate the setting. Then logon to the database and execute: And create function login hook.login() that is to be executed when a client logs in. For example: Remarks: the public execute permission is absolutely necessary because the function will be invoked for everybody / ever","default_branch":null,"files":null,"tree":[],"storefront":"/r/splendiddata","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/splendiddata/login_hook/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}