On Thu, Nov 2, 2017 at 11:36 PM, Fabrízio de Royes Mello <fabriziome...@gmail.com> wrote: > On Thu, Nov 2, 2017 at 5:42 AM, Aleksandr Parfenov > <a.parfe...@postgrespro.ru> wrote: >> Unfortunately, patches 0001 and 0002 don't apply to current master. >> >> The new status of this patch is: Waiting on Author > > Thanks for your review. Rebased versions attached.
Looking at this thread, there are clearly arguments in favor of having a session hook after authentication. One use case mentioned by Robert is inserting data into a table when a user logs in. I can imagine that something like that could be applied to a session ending. /* + * Setup handler to session end hook + */ + if (IsUnderPostmaster) + on_proc_exit(do_session_end_hook, 0); I think that it would be better to place that in ShutdownPostgres. This way it is possible to take actions before any resource is shut down. Passing the database name and user name does not look much useful to me. You can have access to this data already with CurrentUserId and MyDatabaseId. -- Michael -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers