----- Original Message -----
From: "Mattias Kregert" <mattias@kregert.se>
To: <pgsql-general@postgresql.org>
Cc: "Darko Prenosil" <darko.prenosil@finteh.hr>
Sent: Friday, July 04, 2003 7:11 PM
Subject: Re: [GENERAL] Q: Executing functions at connect/disconnect?
Is it possible to use pg_backend_pid() or pg_stat_activity in some way?
I tried to put a rule on pg_stat_activity:
create rule cleanup as on delete to pg_stat_activity do ... <cleanup code>
...but it does not work... i disconnected and the backend was removed from
pg_stat_activity, but the rule did not execute... does anybody know why??
This is an interesting idea !
But unfortunately, I think that triggers and rules are not working on system
objects.
However, I'll try it myself.
Regards !