Re: Server-side hooks for user session start and session end

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Server-side hooks for user session start and session end
Дата
Msg-id 1292.1443290387@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Server-side hooks for user session start and session end  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Server-side hooks for user session start and session end  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: Server-side hooks for user session start and session end  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Server-side hooks for user session start and session end  (Nikolai Zhubr <n-a-zhubr@yandex.ru>)
Список pgsql-general
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2015-09-26 19:53 GMT+02:00 Nikolai Zhubr <n-a-zhubr@yandex.ru>:
>> And the events of session start and session end would seem quite generic
>> and usefull anyway?

> I don't know. I am pretty sceptical - from my experience this request was
> related to unhappy designed projects.

A session-end hook seems pretty problematic to me: you simply cannot
guarantee that it will run at all.  (Consider process crash or server
abort cases.)  So anything built on the assumption that it gets to run
at session end is going to be inherently unreliable.

A session-start hook is already possible at the C-code level, using
session_preload_libraries.  It wouldn't be hard to write an extension
that exposed that in some useful way to SQL code.

            regards, tom lane


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Server-side hooks for user session start and session end
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Server-side hooks for user session start and session end