Re: on connect trigger?

From: "Keith C(dot) Perry" <netadmin(at)vcsn(dot)com>
To: btober(at)seaworthysys(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: on connect trigger?
Date: 2003-11-07 03:07:54
Message-ID: 1068174474.3fab0c8ae9aed@webmail.vcsn.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Quoting btober(at)seaworthysys(dot)com:

> Is there any kind of mechanism in pg 7.3 for doing something like what I
> would describe as a "login trigger" procedure or maybe "on connect"
> trigger, i.e., a way to specify a stored procedure to run when a user
> connects to the database?
>
> What I'm thinking is this. Right now, my end-user GUI application calls a
> procedure which updates the user account expiration date whenever they
> log in. The idea is that accounts that are never used will expire,
> eventually, and those that are active will continually have the
> expiration date pushed
> further ahead each time they log in.
>
> I'd like to not depend on the application making this call, because other
> applications which connect to the same database will be written, and the
> developers might not build in this same explicit procedure call -- it
> really is the kind of thing that is best done on the backend.
>
> ~Berend Tober

Berend,

I've got something like that setup on an e-communities site I built. There was
already a "last action" query/report I had so what I have setup on as part of
the database nightly vacuum is to first delete any account that did not have any
actions for over a year. You don't need to do a trigger to do that. You just
need to make a cron job that run at whatever is an acceptable interval.

--
Keith C. Perry, MS E.E.
Director of Networks & Applications
VCSN, Inc.
http://vcsn.com

____________________________________
This email account is being host by:
VCSN, Inc : http://vcsn.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig O'Shannessy 2003-11-07 03:16:38 Re: int8 primary keys still not using index without manual
Previous Message Craig O'Shannessy 2003-11-07 03:06:59 Re: Optimiser desicion bringing system to its knees?