on connect/on disconnect

Поиск
Список
Период
Сортировка
От Robert Edwards
Тема on connect/on disconnect
Дата
Msg-id 4504B474.9010801@cs.anu.edu.au
обсуждение исходный текст
Ответы Re: on connect/on disconnect
Re: on connect/on disconnect
Список pgsql-sql
(this is my first post to this list...)

I am wondering if Postgres, and/or SQL in general, has a facility to
run a function at connection set-up time (after a successful connection
attempt) and/or at session completion (or disconnect)?

I want to pre-populate a table (actually an INSERT rule on a view)
with some user-specific data that is unlikely to change during the
session and which is "difficult" to process (ie. affects performance
to do it too often).

Clearly, I can do this manually anyway as the first operation after
a connection is established, but I would like also to clear it out
when the session terminates (so, I guess I am really interested in
a "trigger" of some sort on end-of-session).

Purely session/connection-based temporary tables would also do what
I need, but temporary tables don't seem to be able to work that way.

Cheers,

Bob Edwards.


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

Предыдущее
От: "Aaron Bono"
Дата:
Сообщение: Re: Is it possible to left join based on previous joins result
Следующее
От: "Aaron Bono"
Дата:
Сообщение: Re: on connect/on disconnect