Re: [HACKERS] [PATCH] A hook for session start

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [HACKERS] [PATCH] A hook for session start
Дата
Msg-id CAB7nPqSd2YnLicwY_rYgaGPyACVAOxXCQvXRCgJZS9NiGfBhjQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] [PATCH] A hook for session start  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
Ответы Re: [HACKERS] [PATCH] A hook for session start
Список pgsql-hackers
On Thu, Nov 2, 2017 at 11:36 PM, Fabrízio de Royes Mello
<fabriziomello@gmail.com> wrote:
> On Thu, Nov 2, 2017 at 5:42 AM, Aleksandr Parfenov
> <a.parfenov@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 (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] Re: PANIC: invalid index offnum: 186 when processingBRIN indexes in VACUUM
Следующее
От: Aleksandr Parfenov
Дата:
Сообщение: Re: [HACKERS] [PATCH] A hook for session start