X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9DB1956422 for ; Sun, 20 Mar 2005 15:42:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07708-04 for ; Sun, 20 Mar 2005 15:42:49 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id B18F456548 for ; Sun, 20 Mar 2005 15:42:47 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j2KFglOv028652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 20 Mar 2005 08:42:50 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j2KFglws018904; Sun, 20 Mar 2005 08:42:47 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j2KFglfF018903; Sun, 20 Mar 2005 08:42:47 -0700 (MST) (envelope-from mfuhr) Date: Sun, 20 Mar 2005 08:42:47 -0700 From: Michael Fuhr To: Murray Cumming Cc: pgsql-interfaces Subject: Re: Discovering privileges Message-ID: <20050320154247.GA18843@winnie.fuhr.org> References: <1088799354.3319.110.camel@murrayc_debian> <1111330231.5820.4.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1111330231.5820.4.camel@localhost.localdomain> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/53 X-Sequence-Number: 5382 On Sun, Mar 20, 2005 at 03:50:30PM +0100, Murray Cumming wrote: > I'm using the pg_user and pg_group system tables to discover the list of > users, and the groups to which they belong. > > But how can I discover the privileges that these users and groups have > for the various tables. Is this also in one of the system tables? You could look at pg_class.relacl, but the "Access Privilege Inquiry Functions" (has_table_privilege(), etc.) might be easier to use. http://www.postgresql.org/docs/8.0/interactive/functions-info.html#FUNCTIONS-INFO-ACCESS-TABLE -- Michael Fuhr http://www.fuhr.org/~mfuhr/