pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Jerry Asher <jerry.nospam@theashergroup.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_hba, access control for a webserver, superuser, and joe user
Date: Wed, 29 Jan 2003 01:26:56 -0600
Message-ID: <20030129072656.GA19996@wolff.to> (raw)
In-Reply-To: <836fa09a.0301281539.5bd3b38f@posting.google.com>
References: <836fa09a.0301281539.5bd3b38f@posting.google.com>

On Tue, Jan 28, 2003 at 15:39:03 -0800,
  Jerry Asher <jerry.nospam@theashergroup.com> 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



view thread (2+ messages)

Message-ID: <20030129072656.GA19996@wolff.to>
Permalink:  ../20030129072656.GA19996@wolff.to/
Also on:    postgresql.org/message-id/20030129072656.GA19996@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: bruno@wolff.to, jerry.nospam@theashergroup.com
  Subject: Re: pg_hba, access control for a webserver, superuser, and joe user
  In-Reply-To: <20030129072656.GA19996@wolff.to>
  References: <836fa09a.0301281539.5bd3b38f@posting.google.com> <20030129072656.GA19996@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox