Received: from montseny-f.ibernet.com (bcnsf.jazztel.es [212.106.195.71] (may be forged)) by postgresql.org (8.11.3/8.11.4) with ESMTP id f93EB2n93819 for ; Wed, 3 Oct 2001 10:11:03 -0400 (EDT) (envelope-from toomany@dorna.es) Received: from klingon.dorna.es ([212.163.226.3]) by montseny-f.ibernet.com (Post.Office MTA v3.5.3 release 223 ID# 0-70794U9000L900S0V35) with ESMTP id com; Wed, 3 Oct 2001 16:07:20 +0200 Received: from toomany by klingon.dorna.es with local (Exim 3.32 #1 (Debian)) id 15omko-0000AE-00; Wed, 03 Oct 2001 16:12:06 +0200 Date: Wed, 3 Oct 2001 16:12:06 +0200 From: Manuel Trujillo To: Pedro Fonseca Cc: pgsql-admin@postgresql.org Subject: Re: Authorization problem Message-ID: <20011003161206.A560@klingon.dorna.es> References: <9pf352$14e0$1@news.tht.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9pf352$14e0$1@news.tht.net> User-Agent: Mutt/1.3.22i X-Archive-Number: 200110/26 X-Sequence-Number: 2272 On Wed, Oct 03, 2001 at 02:17:15PM +0100, Pedro Fonseca wrote: > Greetings! > > I have 2 PostgreSQL users created. I'd like access to a database restricted > only to one of these users. As it is, in pg_hba.conf, any PostgreSQL user > can connect locally to any database whatsoever: > > # TYPE DATABASE IP_ADDRESS MASK AUTHTYPE MAP > local all trust > host all 127.0.0.1 255.255.255.255 trust > > I have TCP/IP based connections disabled. What I would like would be > something like: > > # TYPE DATABASE IP_ADDRESS MASK AUTHTYPE MAP > local test_db ident test_db_map > > The problem is that the ident AUTHTYPE can only be used for TCP/IP > connections. How do I tell PostgreSQL that I only want to allow > postgres_user_1 to connect to test_db, and not every user? And how do I do > this without using passwords and TCP/IP connections? I think the solution is: 1- create a passwd file for this database (test_db_passwd, for example), with pg_passwd test_db_passwd, and put here with pg_passwd the user's needed. 2- put this in your pg_hba.conf: # TYPE DATABASE IP_ADDRESS MASK AUTHTYPE MAP local test_db password test_db_passwd test_db_map I'm very "newbie" in postgresql, but I think this can solve your problem. Sorry for my bad english, if you speak spanish, you can write to me directly. -- Manuel Trujillo manueltrujillo@dorna.es Technical Engineer http://www.motograndprix.com Dorna Sports S.L. +34 93 4702864