Search Postgresql Archives

Re: Trigger to run @ connection time?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux