Received: from ll.mit.edu (LLMAIL.LL.MIT.EDU [129.55.12.40]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4TESDE16867 for ; Tue, 29 May 2001 10:28:13 -0400 (EDT) (envelope-from gry@ll.mit.edu) Received: (from smtp@localhost) by ll.mit.edu (8.11.3/8.8.8) id f4TERvi18368; Tue, 29 May 2001 10:27:57 -0400 (EDT) Received: from UNKNOWN( ), claiming to be "soi.llan" via SMTP by llmail, id smtpdAAAjba42I; Tue May 29 10:27:51 2001 Received: from sty (sty [ ]) by soi.llan (8.8.0/8.8.0) with SMTP id KAA05002; Tue, 29 May 2001 10:27:51 -0400 (EDT) Date: Tue, 29 May 2001 10:27:51 -0400 From: george young To: Vladislav Breus Cc: pgsql-sql@postgresql.org Subject: Re: sql user management Message-Id: <20010529102751.05572a14.gry@ll.mit.edu> In-Reply-To: <3B125AB4.74AB614E@dtr.donetsk.ua> References: <3B125AB4.74AB614E@dtr.donetsk.ua> X-Mailer: Sylpheed version 0.4.62 (GTK+ 1.2.8; i586-pc-linux-gnu) Organization: MIT Lincoln Laboratory Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200105/306 X-Sequence-Number: 3147 On Mon, 28 May 2001 17:03:32 +0300 Vladislav Breus wrote: > With SQL requests I can create, change privileges of the user... > > Can I access to user information only with sql-requests ? > - Is the user a member of group ? Use the contrib module 'array': [cd $SOURCE/contrib/array make make install] Then, to find what groups 'young' is in, one can do: select g.groname from pg_group g, pg_shadow s where s.usename='young' and g.grolist *= s.usesysid; or select g.grolist *= s.usesysid from pg_group g, pg_shadow s where s.usename='young' and g.groname='originator'; just to see wether or not 'young' is in group 'originator'. > - Has he rights to table ? That's more complicated, but still accessible. You have to get pg_class.relacl from pg_class where relname='yourtable'; and then parse the acl (access control list) and join with pg_group info... Hmm, I haven't tried it -- looks messy... Good luck, George -- Your mouse has moved. Windows NT must be restarted for the change to take effect. Reboot now? [OK]