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

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Server-side hooks for user session start and session end
Дата
Msg-id CAFj8pRAPc=dD4escQDogunekVA4e7Cge99-ShRPDVonP8psRgg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Server-side hooks for user session start and session end  (Nikolai Zhubr <n-a-zhubr@yandex.ru>)
Ответы Re: Server-side hooks for user session start and session end
Список pgsql-general


2015-09-26 19:53 GMT+02:00 Nikolai Zhubr <n-a-zhubr@yandex.ru>:
Hi Pavel,
26.09.2015 19:26, Pavel Stehule wrote:
[...]
This cannot be solved without patching PostgreSQL source code :( . There
are not good hooks for custom extension. Patch is relative simple, but I
cannot to publish it.

Ok, I see. Creating such a patch might be not very hard actually.
But living with custom-patched server could cause massive pain later...

You have to modify main loop in src/backend/tcop/postgres.c file. Login
point can be immediately before loop. Logout point can be joined to
'X',EOF message.

Thanks for the hint, I've noticed this loop while searching for some more 'regular' methods.

Attention - there are some corner case, what are necessary to solve -
mainly how to handle exceptions in login/logout procedures.

Right. And I'd guess that might be the reason for not implementing such thing in upstream (yet) - the lack of proper context for exceptions and such.

p.s. I understand so this hack is necessary for porting older
application from other databases, but I am not sure if it is a good idea
to use it. Not all tasks can be solved well in database.

No, the application in question has been running on top of postgres almost from its very start and for quite some years successfully now, it definitely does not contain anything foreign to postgres.
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.

Pavel

 



Thank you,
Nikolai


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

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

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