From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | Nikolai Zhubr <n-a-zhubr(at)yandex(dot)ru>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Server-side hooks for user session start and session end |
Date: | 2015-09-26 18:29:36 |
Message-ID: | 3997.1443292176@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> 2015-09-26 19:59 GMT+02:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> 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.
> years ago I tried it, if I remember well. I had a problems with SPI calls,
> because some caches was not initialized. I am not sure, and I didn't test
> last time.
You'd have to start your own transaction if you wanted one, and any
uncaught error would effectively be FATAL because it would terminate the
session, but otherwise I don't see why that wouldn't work.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Pavel Stehule | 2015-09-26 18:41:52 | Re: Server-side hooks for user session start and session end |
Previous Message | Pavel Stehule | 2015-09-26 18:23:03 | Re: Server-side hooks for user session start and session end |