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

Поиск
Список
Период
Сортировка
От Nikolai Zhubr
Тема Re: Server-side hooks for user session start and session end
Дата
Msg-id 56073462.8030600@yandex.ru
обсуждение исходный текст
Ответ на Re: Server-side hooks for user session start and session end  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Server-side hooks for user session start and session end
Список pgsql-general
26.09.2015 20:59, Tom Lane wrote:
[...]
> 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.

Yes, I understand that.
For such cases (of e.g. abnormal shutdown) it would also be nice if a
database could 'autorun' some specified function just after server has
performed whetever startup/replay/cleanup procedures necessary and
immediately before it is ready for normal operation. This would allow to
perform some checks and cleanups to restore consistency. And actually,
such 'autorun' function could be interesting regardless of this session
begin/end thing.
And there are already quite some hooks in use for session-end cleanups
at C-level, like e.g. for disposing temp tables, just none of them
expose anything to SQL level. I'd guess this technique is available for
use by extensions, so potentially SQL-level hook could also be
implemented. Though I think it is a bit beyond my capability at the
moment...

Regards,


Thank you,
Nikolai


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

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