Re: pg_hba.conf "sameuser"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tim Frank <tfrank(at)registrar(dot)uoguelph(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_hba.conf "sameuser"
Date: 2001-03-14 18:26:50
Message-ID: 28420.984594410@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tim Frank <tfrank(at)registrar(dot)uoguelph(dot)ca> writes:
> I'm still trying to get a handle on all of the possible authentication
> methods and what combinations will work best for what I need, and what
> combinations will work in general. I am having difficulty getting the
> "sameuser" parameter to do anything under DBNAME.

Keep in mind that DBNAME and the host IP info are a pattern to be
matched. The postmaster looks for the first line in pg_hba.conf that
matches the connection request, and then applies the AUTHTYPE method
specified in that line. If DBNAME is "sameuser" then the line matches
requests where the username and dbname are the same --- but if they're
not the same, the postmaster will keep right on looking for a matching
line. So your example didn't prove anything except that you had another
pg_hba line that would allow connections where the dbname and username
are different.

In general you have to look at the whole set of potentially applicable
pg_hba.conf lines and the order that they appear in to understand the
behavior. Showing one line won't let anyone help you.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Frank 2001-03-14 18:42:06 Re: pg_hba.conf "sameuser"
Previous Message Tom Lane 2001-03-14 18:18:35 Re: [NOVICE] Re: Re: compilation error <segunda parte>