Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2EE7D475F4C for ; Thu, 22 Aug 2002 08:12:56 -0400 (EDT) Received: from wolff.to (wolff.to [66.92.219.49]) by postgresql.org (Postfix) with SMTP id 14F48475F00 for ; Thu, 22 Aug 2002 08:12:55 -0400 (EDT) Received: (qmail 31848 invoked by uid 500); 22 Aug 2002 12:19:57 -0000 Date: Thu, 22 Aug 2002 07:19:57 -0500 From: Bruno Wolff III To: Bruce Momjian Cc: Kris Deugau , pgsql-admin@postgresql.org Subject: Re: DB Access Restrictions Message-ID: <20020822121957.GA31721@wolff.to> Mail-Followup-To: Bruce Momjian , Kris Deugau , pgsql-admin@postgresql.org References: <3D5AD560.AEBD8AF8@webhart.deepnet.cx> <200208220205.g7M25oZ22546@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200208220205.g7M25oZ22546@candle.pha.pa.us> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/259 X-Sequence-Number: 5373 On Wed, Aug 21, 2002 at 22:05:49 -0400, Bruce Momjian wrote: > > In 7.3, due out in a few months, there is a USER column where you can > list users or specify a filename containing usernames. Another key thing about 7.3 is that that match for access now includes the username, so you can have multiple access methods for different users on the same DB. I am currently using the following in a CVS version of 7.3: # TYPE DATABASE USER IP_ADDRESS MASK AUTH_TYPE local all postgres ident postgres local area,book,template1 bruno ident sameuser local area,book nobody ident nobody local sameuser all ident sameuser The ident file has the following in it: # MAP IDENT PGUSERNAME postgres root postgres postgres bruno postgres postgres postgres postgres nobody bruno nobody nobody nobody nobody The net result of this is that the postgres account can use any database. bruno can use area, book, bruno or template1 (the last one is needed to create new databases). nobody (the web server) can access area, book and nobody (if it existed). Other users can access a db matching their username. The postgres user can be used by bruno, root or postgres. And the nobody user can be used by bruno or nobody. Other users are stuck using their normal username to connect to postgres. I will probably play around with this setup some more, but it does illustrate a way to have a bunch of users with databases matching their usernames, but also have other databases and some users that can access more than just their own db.