Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 84BF14776BA for ; Wed, 29 Jan 2003 02:49:44 -0500 (EST) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id D1EC0478BE2 for ; Wed, 29 Jan 2003 02:14:13 -0500 (EST) Received: (qmail 20126 invoked by uid 500); 29 Jan 2003 07:26:56 -0000 Date: Wed, 29 Jan 2003 01:26:56 -0600 From: Bruno Wolff III To: Jerry Asher Cc: pgsql-admin@postgresql.org Subject: Re: pg_hba, access control for a webserver, superuser, and joe user Message-ID: <20030129072656.GA19996@wolff.to> Mail-Followup-To: Jerry Asher , pgsql-admin@postgresql.org References: <836fa09a.0301281539.5bd3b38f@posting.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <836fa09a.0301281539.5bd3b38f@posting.google.com> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/326 X-Sequence-Number: 7168 On Tue, Jan 28, 2003 at 15:39:03 -0800, Jerry Asher wrote: > > Does the order of statements in pg_hba.conf matter? > Is there a priority and a fallback of sorts? Try this first mechanism > and if that fails, try the next mechanism? Yes the order matters. Only the first rule that matches is used to do the authentication. If it fails no other rules are tried. For your kind of set up, you want to do the user specific rules first (postgres and the web user) followed by the wildcard rule for users connecting to a matching database. Here is a sample that I use that is similar to what you are trying to do. HBA: local all postgres ident postgres local area,book,cube,template1 bruno ident sameuser local area,book nobody ident nobody local sameuser all ident sameuser IDENT: postgres root postgres postgres bruno postgres postgres postgres postgres nobody bruno nobody nobody nobody nobody