How to obtain info about the user?

Started by Ismael ....over 17 years ago4 messagesgeneral
Jump to latest
#1Ismael ....
ismaelpsp@hotmail.com

Hi there,
I'm connecting to postgres from java using the postgres driver...
and I need to get the info about the user that is connected to the DB, lets say
for example: name, groups, permisions (select, update, execute)...

Does anyone knows how can I get that info?

Also, if the user is in the group "admin", I need to geat a list of users and
the permissions of each... just like pgadmin3 does...
_________________________________________________________________
P.D. Checa las nuevas fotos de mi Space
http://home.services.spaces.live.com/

#2Joshua D. Drake
jd@commandprompt.com
In reply to: Ismael .... (#1)
Re: How to obtain info about the user?

On Thu, 2008-07-10 at 11:08 -0500, Ismael Almaraz Ezparza wrote:

Hi there,
I'm connecting to postgres from java using the postgres driver...
and I need to get the info about the user that is connected to the DB, lets say
for example: name, groups, permisions (select, update, execute)...

Does anyone knows how can I get that info?

Also, if the user is in the group "admin", I need to geat a list of users and
the permissions of each... just like pgadmin3 does...

I suggest you turn on query logging to see how pgadmin3 does it.

Joshua D. Drake

#3William Leite Araújo
william.bh@gmail.com
In reply to: Joshua D. Drake (#2)
Re: How to obtain info about the user?

*SELECT* pg_has_role() , has_table_privilege(), has_database_privilege(),
has_function_privilege

On Thu, Jul 10, 2008 at 1:15 PM, Joshua D. Drake <jd@commandprompt.com>
wrote:

On Thu, 2008-07-10 at 11:08 -0500, Ismael Almaraz Ezparza wrote:

Hi there,
I'm connecting to postgres from java using the postgres driver...
and I need to get the info about the user that is connected to the DB,

lets say

for example: name, groups, permisions (select, update, execute)...

Does anyone knows how can I get that info?

Also, if the user is in the group "admin", I need to geat a list of users

and

the permissions of each... just like pgadmin3 does...

I suggest you turn on query logging to see how pgadmin3 does it.

Joshua D. Drake

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
William Leite Araújo
Pai 0.6 beta 2.1 "Dizem que agora melhora..."

#4Ismael ....
ismaelpsp@hotmail.com
In reply to: William Leite Araújo (#3)
Re: How to obtain info about the user?

SELECT pg_has_role() , has_table_privilege(), has_database_privilege(), has_function_privilege

Tanks, I'll make use of that
Only one last thing:
How do I get the users list?

On Thu, Jul 10, 2008 at 1:15 PM, Joshua D. Drake wrote:

On Thu, 2008-07-10 at 11:08 -0500, Ismael Almaraz Ezparza wrote:

Hi there,
I'm connecting to postgres from java using the postgres driver...
and I need to get the info about the user that is connected to the DB, lets say
for example: name, groups, permisions (select, update, execute)...

Does anyone knows how can I get that info?

Also, if the user is in the group "admin", I need to geat a list of users and
the permissions of each... just like pgadmin3 does...

I suggest you turn on query logging to see how pgadmin3 does it.

Joshua D. Drake

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
William Leite Araújo
Pai 0.6 beta 2.1 "Dizem que agora melhora..."

_________________________________________________________________
Los mejores conciertos en exclusiva por MSN in concert
http://video.msn.com/?mkt=es-mx