Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3P2Pw320319 for ; Tue, 24 Apr 2001 22:25:58 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f3P2D4867255 for pgsql-admin@postgresql.org; Tue, 24 Apr 2001 22:13:04 -0400 (EDT) (envelope-from news) From: Tim Frank X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Restricting user access to databases Date: Wed, 25 Apr 2001 02:11:21 GMT Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 60 Message-ID: <20010425.2112166@cr625228-a.ktchnr1.on.wave.home.com> References: <3AE58E8D.4090209@sulem.freeserve.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Complaints-To: scrappy@hub.org X-Priority: 3 (Normal) X-Newsreader: Mozilla/3.0 (compatible; StarOffice/5.2;Win32) To: pgsql-admin@postgresql.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by postgresql.org id f3P2Pw320320 X-Archive-Number: 200104/121 X-Sequence-Number: 1258 Jared, It doesn't jump out at you but if you read the pg_hba.conf help REALLY closely you will find that you can do this: host sameuser 192.168.3.0 255.255.255.0 password Where "sameuser" under the DBNAME allows connection to a database of the same name of the user trying to connect. This isn't "quite" what you are asking for, but if you make sure that users' databases are named the same as their user account it will work. It really doesn't work for my situation since our databases aren't specific to "users". You might be able to work with that though. Tim Frank >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 24/04/01, 9:35:09 AM, jsulem@sulem.freeserve.co.uk (Jared Sulem) wrote regarding Re: Restricting user access to databases: > Jared Sulem wrote: > > Is there anyway to make PostgreSQL automatically only grant access to > > databases by their owners, and preferably database superusers, rather > > than making lots of pg_hba.conf entries and password files? > Just had an idea. Another token could be added to the pg_hba.conf file: > 'owner'. Then a line like: > host all 192.168.3.0 255.255.255.0 password owner > Would only allow users that owned the database they were trying to > access to login. 'owner' being like a virtual file containing only the > owner's name of the database, that the user is trying to access. > (Or is there already a way to easily do this?) > Jared > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > http://www.postgresql.org/search.mpl