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 05:10:09
Message-ID: bf05e51c0609102210ree7629dw16f544fc451de7dc@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:
>
>
> As I understand it, connection pooling, as used by a web app, still
> needs to connect "per-database-user" (and usually this is the same
> "web-server" user). If the web app is connecting to the database
> server as different database users, then different connections would
> be set up. If the number of open connections exceeds the number
> allowed to the database server, then older unused connections would
> be terminated to allow new ones to be created. Is this correct?

Don't mean to get off topic but to answer your question...

Typically the web app has a single log in user. You don't have the user
log into the database. Connection pooling typically does not terminate
connections to the database unless it decides to shrink the connection pool
do to lack of use. It doesn't disconnect when it exceeds the number of
allowed users - it reuses the connections as much as possible to reduce the
overhead of making connections.

Or is it possible, over the same connection, to change the database
> user? My understanding of the frontend/backend protocol is that this
> is not allowed.

I could not find this in the documentation - not sure.

Anyway, I still need to know if running functions during connection
> setup and tear-down, or change of user, is possible or not.

If there is a table that keeps track of connection/disconnection you could
put a trigger on that but I cannot find anything about this in the
documentation.

Guess we will need feedback from someone more knowledgable than I...

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Penchalaiah P. 2006-09-11 07:46:48 hi i am gettin error when i am deleting a function from my pgadmin
Previous Message Richard Broersma Jr 2006-09-11 05:01:29 Re: where clause subqueries vs multiple rows results