Re: Trigger to run @ connection time?

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Trigger to run @ connection time?
Дата
Msg-id BEFA5FEC-376E-45DA-A1C8-37E0FCE2AD86@solfertje.student.utwente.nl
обсуждение исходный текст
Ответ на Trigger to run @ connection time?  ("Kynn Jones" <kynnjo@gmail.com>)
Ответы Re: Trigger to run @ connection time?  ("Kynn Jones" <kynnjo@gmail.com>)
Список pgsql-general
On Mar 10, 2008, at 9:07 PM, Kynn Jones wrote:

> So I tried to find some system table that would get modified
> whenever a new connection was made, but I was unsuccessful.  The
> closest I found was the VIEW pg_activity, and the crucial
> information I need from this view comes from procedures like
> pg_stat_get_backend_pid().

You can't define triggers on system tables.

> Is there a bona fide table (not a view!) that I could use to define
> an "on connect" trigger?  (This table would not only have to
> undergo some INSERT or UPDATE event at the time of the new
> connection, but it should also provide enough information to allow
> my code to determine which database is being connected to.)

I'm afraid not, although there's been mention on this ML of on
connect triggers before. Not sure whether that got solved though...

> If not, is there some other way to set up a trigger that

Closest thing I can think of is defining a table that you insert a
record in as soon as you connect and put a trigger on that.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,47d5c63d233091216612506!



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

Предыдущее
От: John Cartwright
Дата:
Сообщение: Re: php pg_connect fails, pgsql works - RESOLVED
Следующее
От: Kevin Kempter
Дата:
Сообщение: PostgreSQL and MOLAP ?