Automatically assuming a specific role after connecting to pg - Mailing list pgsql-general

From Florian G. Pflug
Subject Automatically assuming a specific role after connecting to pg
Date
Msg-id 444A74EB.1010202@phlo.org
Whole thread Raw
Responses Re: Automatically assuming a specific role after connecting to pg  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Automatically assuming a specific role after connecting to pg  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
I'd like to be able to connect to postgres, and automatically assume a specific role.

I imagine something like
create role myuser ;
create role dev noinherit ;
create role admin noinherit superuser ;
grant dev to myuser ;
grant admin to myuser ;

Now, I'd like a connect as "myuser/admin" to be equivalent to a connect as "myuser"
and then issuing "set role admin". The same should be true for "myuser/dev".

Would it be hard to patch postgres to do that? And would such a patch have a chance
of being accepted into 8.2 (or 8.3)

greetings, Florian Pflug

pgsql-general by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: sudo-like behavior
Next
From: Francisco Reyes
Date:
Subject: out of memory for query result