Switching connection on the fly - Mailing list pgsql-hackers

From Shridhar Daithankar
Subject Switching connection on the fly
Date
Msg-id 3E353D3F.7283.9FA9C97@localhost
Whole thread Raw
Responses Re: Switching connection on the fly
List pgsql-hackers
Hi all,

Recently solving a design problem for a friend, an idea crossed my mind.

Is it possible for an established connection to backend, to switch user on the 
fly, if proper credentials are supplied?

If this can be done, it would avoid initialization penalty of a new conenction 
and many applications which does their own user management, can deligate the 
task to backend. 

Many applications are written in such a way that application always connects 
and operates as one user and does necessary access control. There are situatons 
where such a design is best available choice.

If it can switch connection on the fly, it will allow to have much finer 
control over database access.

That would help immensely for any applications that use connection pooling. 
Right now, if an app uses connection pooling, it has to go via a single 
application user and do all the things on it's own.

Besides I think this idea would be a smart implementation of what oracle called 
thin/virtual users.

Any thoughts?

ByeShridhar

--
The First Rule of Program Optimization:    Don't do it.The Second Rule of Program 
Optimization (for experts only!):    Don't do it yet.        -- Michael Jackson



pgsql-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: [CYGWIN] Have a PG 7.3.1 Windows (cygwin) easy installer... now what to do with it?
Next
From: Antonio Scotti
Date:
Subject: On Commit Triggers?