Switching roles as an replacement of connection pooling tools - Mailing list pgsql-general

I have a feeling that slight enhancement to commands "SET ROLE" or "SET
SESSION AUTHORIZATION" can obsolete and outperform external connection
pooling tools in some use cases.

Assume we are in the following situation:

- There are a million schemas each owned by a distinct role.
- Every role is not allowed to access any other schema except its own.

If command "SET SESSION AUTHORIZATION" is enhanced to accept two
additional arguments

PASSWORD <password>

, then a client simply establishes only one connection to server and do
jobs for a million roles.

Say I want to gain full access to "schema2", I simply issue these two
commands

SET SESSION AUTHORIZATION user2 PASSWORD p2;
SET SEARCH_PATH TO schema2,pg_category;

, where "p2" is the password associated with role "user2".

If the current role is superuser "postgres" and it wants to downgrade
itself to role "user3", then it simply sends these commands:

SET SESSION AUTHORIZATION user3;
SET SEARCH_PATH TO schema3,pg_category;

Does my points make sense?
Is it eligible for feature request?

Best Regards,
CN

--
http://www.fastmail.com - Accessible with your email software
                          or over the web



pgsql-general by date:

Previous
From: Daniel Westermann
Date:
Subject: Re: Deleting a table file does not raise an error when the table is touched afterwards, why?
Next
From: Brian Sutherland
Date:
Subject: Re: After replication failover: could not read block X in file Y read only 0 of 8192 bytes