X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5261F9FB1B8 for ; Thu, 1 Jun 2006 04:10:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 53643-10 for ; Thu, 1 Jun 2006 04:10:13 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web54206.mail.yahoo.com (web54206.mail.yahoo.com [206.190.39.248]) by postgresql.org (Postfix) with SMTP id 7D6B99FA3A6 for ; Thu, 1 Jun 2006 04:10:09 -0300 (ADT) Received: (qmail 47603 invoked by uid 60001); 1 Jun 2006 07:10:08 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=1GwR5oSvwTYOZoBhczNiH3CK8D+yEO8hZGpcG1mY7L/+Em3ZPYIh/FAYP8McHdYq3xMLxu4Fw801texrHwvNqn0Z8Rbs1O37WP+HgU5D3VYyTF1OzIjFVV3mvbrSGA94C98Is6MkRIYnawn/OndP9iXxhliWiElywh9FFbg/VYE= ; Message-ID: <20060601071008.47601.qmail@web54206.mail.yahoo.com> Received: from [64.81.86.61] by web54206.mail.yahoo.com via HTTP; Thu, 01 Jun 2006 00:10:08 PDT Date: Thu, 1 Jun 2006 00:10:08 -0700 (PDT) From: "J." Subject: Re: granted select works in psql but not via jdbc To: pgsql-jdbc@postgresql.org In-Reply-To: <20060531234220.GC1436@timbira.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-2008085389-1149145808=:47203" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/1 X-Sequence-Number: 15281 --0-2008085389-1149145808=:47203 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 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 --0-2008085389-1149145808=:47203 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 --0-2008085389-1149145808=:47203--