From: Aaron Bono <postgresql@aranya.com>
To: Robert Edwards <bob@cs.anu.edu.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: on connect/on disconnect
Date: Mon, 11 Sep 2006 00:10:09 -0500
Message-ID: <bf05e51c0609102210ree7629dw16f544fc451de7dc@mail.gmail.com> (raw)
In-Reply-To: <4504EB87.3090502@cs.anu.edu.au>
References: <4504B474.9010801@cs.anu.edu.au>
<bf05e51c0609102128u7a6d98e3g9faf634a71736bd@mail.gmail.com>
<4504EB87.3090502@cs.anu.edu.au>
On 9/10/06, Robert Edwards <bob@cs.anu.edu.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.comhttp://codeelixir.com
==================================================================
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: postgresql@aranya.com, bob@cs.anu.edu.au
Subject: Re: on connect/on disconnect
In-Reply-To: <bf05e51c0609102210ree7629dw16f544fc451de7dc@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox