Re: on connect/on disconnect

From: "Aaron Bono" <postgresql(at)aranya(dot)com>
To: "Robert Edwards" <bob(at)cs(dot)anu(dot)edu(dot)au>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: on connect/on disconnect
Date: 2006-09-11 04:28:43
Message-ID: bf05e51c0609102128u7a6d98e3g9faf634a71736bd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 9/10/06, Robert Edwards <bob(at)cs(dot)anu(dot)edu(dot)au> wrote:
>
> (this is my first post to this list...)
>
> I am wondering if Postgres, and/or SQL in general, has a facility to
> run a function at connection set-up time (after a successful connection
> attempt) and/or at session completion (or disconnect)?
>
> I want to pre-populate a table (actually an INSERT rule on a view)
> with some user-specific data that is unlikely to change during the
> session and which is "difficult" to process (ie. affects performance
> to do it too often).
>
> Clearly, I can do this manually anyway as the first operation after
> a connection is established, but I would like also to clear it out
> when the session terminates (so, I guess I am really interested in
> a "trigger" of some sort on end-of-session).
>
> Purely session/connection-based temporary tables would also do what
> I need, but temporary tables don't seem to be able to work that way.

What kind of operation are you wanting to do? Would it work if an
application like a web site used connection pooling - thus sharing the
session across application users and rarely if ever
connecting/disconnecting?

==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
http://codeelixir.com
==================================================================

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Robert Edwards 2006-09-11 04:52:23 Re: on connect/on disconnect
Previous Message James Cloos 2006-09-11 03:27:59 where clause subqueries vs multiple rows results