How to get user's role?

Started by Armen Rizalover 21 years ago2 messagesgeneral
Jump to latest
#1Armen Rizal
armenrz@starprise.net

Hi all,

I want to get what roles/groups that the current user is member of.
I tried to use the following commands but they both returned no rows.

SELECT * FROM information_schema.enabled_roles
SELECT * FROM information_schema.applicable_roles

Anybody know how to solve this ? or anybody has a certain
function that look up for user's roles/groups ?

Thanks in advanced,

Armen

#2Michael Fuhr
mike@fuhr.org
In reply to: Armen Rizal (#1)
Re: How to get user's role?

On Thu, Sep 30, 2004 at 10:26:41AM +0700, Armen Rizal wrote:

I want to get what roles/groups that the current user is member of.
I tried to use the following commands but they both returned no rows.

SELECT * FROM information_schema.enabled_roles
SELECT * FROM information_schema.applicable_roles

What version of PostgreSQL are you using? Are you sure the current
user belongs to any groups? What's the output of the following
queries?

SELECT current_user;
SELECT usename, usesysid FROM pg_user WHERE usename = current_user;
SELECT * FROM pg_group;

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/