Connection/closedown triggers for backends? - Mailing list pgsql-general

From Richard Huxton
Subject Connection/closedown triggers for backends?
Date
Msg-id 000f01c0a404$79057880$1001a8c0@archonet.com
Whole thread Raw
List pgsql-general
Does such a thing exist (I'm guessing not)

What I'd like is to be able to call a function when someone connects to a
database and another when they disconnect.

Obviously my application can call a function when it first connects, but
might not be able to do so on disconnect (e.g. user pulls plug)

Ideally there'd be a "pg_connections" table with a PID and a time and I
could add triggers to the insert and delete actions.

If there's no way of doing this internally, I've got ways to work around it
but they're not nearly as pleasant.

- Richard Huxton


pgsql-general by date:

Previous
From: brichard@cafod.org.uk (Bruce Richardson)
Date:
Subject: Re: can a trigger on insert -> update other tables?
Next
From: Ben
Date:
Subject: Why is explain horribly optimistic for sorts?