Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1B13UE87703 for ; Sun, 10 Feb 2002 20:03:34 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 6CFC8D5FA; Sun, 10 Feb 2002 17:03:27 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 5869A5BF8; Sun, 10 Feb 2002 17:03:27 -0800 (PST) Date: Sun, 10 Feb 2002 17:03:27 -0800 (PST) From: Stephan Szabo To: Jon August Cc: Chris Ruprecht , PostGreSQL Admin Group Subject: Re: user to database restriction? In-Reply-To: Message-ID: <20020210170136.C73516-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200202/93 X-Sequence-Number: 3252 On Sun, 10 Feb 2002, Jon August wrote: > > That seems like a lot of work. . . and could become easily outdated. No? > > How about in pg_hba.conf? There's no way to say only user xyz can connect > to database abc? > > I tried something like this in my pg_hba.conf, but now nobody can connect > to it. > > local all password postgres > host all xxx.xxx.xxx.xxx 255.255.255.255 password postgres > local shopdb password mark > host shopdb xxx.xxx.xxx.xxx 255.255.255.255 password mark > > I was hoping this config would permit user "postgres" to connect to any > database, but limit user "mark" to shopdb. The final argument goes to an external file in $PGDATA that lists users (and optionally passwords) for the users that are allowed into the db.