Automatically assuming a specific role after connecting to pg

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Automatically assuming a specific role after connecting to pg
Date: 2006-04-22 18:24:43
Message-ID: 444A74EB.1010202@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Reyes 2006-04-22 18:41:13 out of memory for query result
Previous Message Florian G. Pflug 2006-04-22 18:22:22 Re: sudo-like behavior