From vlad@dtr.donetsk.ua Mon May 28 12:33:17 2001 Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f4SCXHA94433 for ; Mon, 28 May 2001 08:33:17 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4SAS4A45270 for ; Mon, 28 May 2001 06:28:04 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f4SAFER12792 for pgsql-sql@postgresql.org; Mon, 28 May 2001 06:15:14 -0400 (EDT) (envelope-from news) From: Vladislav Breus X-Newsgroups: comp.databases.postgresql.sql Subject: sql user management Date: Mon, 28 May 2001 13:14:44 +0300 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 5 Message-ID: <3B122514.39A42B43@dtr.donetsk.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.77 [en] (WinNT; U) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200105/294 X-Sequence-Number: 3123 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 ? - Has he rights to table ? From vlad@dtr.donetsk.ua Mon May 28 14:28:06 2001 Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4SES6A52080 for ; Mon, 28 May 2001 10:28:06 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f4SE4TT15260 for pgsql-sql@postgresql.org; Mon, 28 May 2001 10:04:29 -0400 (EDT) (envelope-from news) From: Vladislav Breus X-Newsgroups: comp.databases.postgresql.sql Subject: sql user management Date: Mon, 28 May 2001 17:03:32 +0300 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 5 Message-ID: <3B125AB4.74AB614E@dtr.donetsk.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.77 [en] (WinNT; U) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200105/296 X-Sequence-Number: 3137 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 ? - Has he rights to table
? From gry@ll.mit.edu Tue May 29 14:28:13 2001 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]