pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedgranted select works in psql but not via jdbc
3+ messages / 2 participants
[nested] [flat]
* granted select works in psql but not via jdbc
@ 2006-05-31 16:21 J. <sweepingoar@yahoo.com>
2006-05-31 23:42 ` Re: granted select works in psql but not via jdbc Euler Taveira de Oliveira <euler@timbira.com>
0 siblings, 1 reply; 3+ messages in thread
From: J. @ 2006-05-31 16:21 UTC (permalink / raw)
To: pgsql-jdbc
I'm trying to set up a system where users will be limited based on their access. To do this I'm querying db_roles and if an exception is thrown, they're not a db admin. The problem is that I've done this:
grant select on pg_roles to db_mid_level_admin;
then any member of the role db_mid_level_admin can query db_roles using psql, but when I try it in jdbc it throws an exception (permission denied for relation pg_roles).
Same user, different behavior in psql vs jdbc. I can't make this admin level superuser because then they'd have access to some stuff they shouldn't. Thanks.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: granted select works in psql but not via jdbc
2006-05-31 16:21 granted select works in psql but not via jdbc J. <sweepingoar@yahoo.com>
@ 2006-05-31 23:42 ` Euler Taveira de Oliveira <euler@timbira.com>
2006-06-01 07:10 ` Re: granted select works in psql but not via jdbc J. <sweepingoar@yahoo.com>
0 siblings, 1 reply; 3+ messages in thread
From: Euler Taveira de Oliveira @ 2006-05-31 23:42 UTC (permalink / raw)
To: J. <sweepingoar@yahoo.com>; +Cc: pgsql-jdbc
J. wrote:
> I'm trying to set up a system where users will be limited based on their access. To do this I'm querying db_roles and if an exception is thrown, they're not a db admin. The problem is that I've done this:
>
> grant select on pg_roles to db_mid_level_admin;
^^^^^^^^^
Wouldn't it be db_roles?
--
Euler Taveira de Oliveira
http://www.timbira.com/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: granted select works in psql but not via jdbc
2006-05-31 16:21 granted select works in psql but not via jdbc J. <sweepingoar@yahoo.com>
2006-05-31 23:42 ` Re: granted select works in psql but not via jdbc Euler Taveira de Oliveira <euler@timbira.com>
@ 2006-06-01 07:10 ` J. <sweepingoar@yahoo.com>
0 siblings, 0 replies; 3+ messages in thread
From: J. @ 2006-06-01 07:10 UTC (permalink / raw)
To: pgsql-jdbc
db_roles doesn't seem to exist as a table. A lot of tables seem to start with "pg_" if they deal with roles and privileges.
I was able to solve the problem by creating dummy tables that had very specific privileges and catching exceptions to determine what group the user belonged to so I could display the appropriate options. I got the grade on the assignment, but I still don't get why a user could select from pg_roles from the psql prompt, but not via jdbc statements.
Euler Taveira de Oliveira <euler@timbira.com> wrote: J. wrote:
> I'm trying to set up a system where users will be limited based on their access. To do this I'm querying db_roles and if an exception is thrown, they're not a db admin. The problem is that I've done this:
>
> grant select on pg_roles to db_mid_level_admin;
^^^^^^^^^
Wouldn't it be db_roles?
--
Euler Taveira de Oliveira
http://www.timbira.com/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2006-06-01 07:10 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-31 16:21 granted select works in psql but not via jdbc J. <sweepingoar@yahoo.com>
2006-05-31 23:42 ` Euler Taveira de Oliveira <euler@timbira.com>
2006-06-01 07:10 ` J. <sweepingoar@yahoo.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox