X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 348A111F6707 for ; Tue, 4 Apr 2006 06:25:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71827-10 for ; Tue, 4 Apr 2006 06:25:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from hyperion.stayhosted.com (hyperion.stayhosted.com [70.84.193.98]) by postgresql.org (Postfix) with ESMTP id 1BA7111F66BC for ; Tue, 4 Apr 2006 06:25:02 -0300 (ADT) Received: from host86-143-156-152.range86-143.btcentralplus.com ([86.143.156.152]) by hyperion.stayhosted.com with esmtpa (Exim 4.52) id 1FQhmW-0000o9-Vj for pgsql-admin@postgresql.org; Tue, 04 Apr 2006 09:25:04 +0000 Message-ID: <44323B49.4000305@gmail.com> Date: Tue, 04 Apr 2006 10:24:25 +0100 From: Milen Dzhumerov User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Permissions References: <4431937F.808@gmail.com> <17016.1144100477@sss.pgh.pa.us> In-Reply-To: <17016.1144100477@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hyperion.stayhosted.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - gmail.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200604/43 X-Sequence-Number: 21212 Tom Lane wrote: > Milen Dzhumerov writes: > >> I've been trying to figure a few things lately but I could not so I'm >> asking on the list. I need to programmatically (through JDBC): >> > > >> 1. Figure out if the currently logged in user can create a schema >> 2. Figure out if a role has USAGE privileges on a schema >> 3. Figure out if a role has CREATE privileges on a schema >> 4. Figure out if a user can create a table in a schema >> > > >> I've been reading the online docs but I could nowhere see any examples >> of finding out that information through the information_schema schema. I >> was advised not to poke around with the pg_* schemas since they can >> change frequently. >> > > Check out the has_foo_privilege family of functions: > http://www.postgresql.org/docs/8.1/static/functions-info.html > > >> I can retrieve all the necessary permissions for tables from the >> information_schema.table_privileges table with no problems but I'm >> puzzled about database & schema privileges. >> > > I think that those privileges are PG extensions to the standard, which > is why the standard information_schema views don't know about them ... > > regards, tom lane > > Thanks a lot. That's all I needed. Kind regards, gamehack