From: | arnaud gaboury <arnaud(dot)gaboury(at)gmail(dot)com> |
---|---|
To: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: confusion about user paring with pg_hba and pg_ident |
Date: | 2016-10-11 13:47:35 |
Message-ID: | CAK1hC9t6sKK-XucbRdQM__J6MNoPo21y+afPvquASe=vXNgUyg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, Oct 11, 2016 at 3:45 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:
> On 10/11/2016 04:25 AM, arnaud gaboury wrote:
>
> > I am a little confused about some of my settings when it comes to map
>
> > linux/psql users.
>
> >
>
> > I have two databases: mattermost and thetradinghall
>
> > I have two linux users: mattermost and dovecot. mattermost is the one
>
> > who want to talk to mattermost and dovecot the one who want to talk to
>
> > thetradinghall.
>
> > I have two postresql users: mmuser and mailman.
>
> >
>
> > Here are the relevant part of my config files:
>
> >
>
> > pg_hba.conf
>
> > -------------------
>
> > local thetradinghall mailman peer
>
> > map=mailmap
>
> > local mattermost mmuser peer
>
> > map=mattermap
>
> >
>
> > pg_ident.conf
>
> > ----------------------
>
> > mailmap dovecot mailman
>
> > mattermap mattermost mmuser
>
> >
>
> > * question: can I use same mapname for my both DB, or using two mapnames
>
> > like I did is the correct way?
>
>
>
> Yes:
>
>
>
> https://www.postgresql.org/docs/9.5/static/auth-username-maps.html
>
>
>
> "Since different mappings might be needed for different connections, the
>
> name of the map to be used is specified in the map-name parameter in
>
> pg_hba.conf to indicate which map to use for each individual connection."
>
>
>
>
>
> >
>
> > Now testing:
>
> > -----------------------------
>
> > bash-4.3$ whoami
>
> > mattermost
>
> > bash-4.3$ psql postgres:///mattermost?
>
> > psql: FATAL: no pg_hba.conf entry for host "[local]", user
>
> > "mattermost", database "mattermost", SSL off
>
> > -----------------------------------
>
> >
>
> > I thought my settings told postgres that linux user mattermost was
>
> > mapped by psql user mmuser (which of course holds the mattermost DB),
>
> > but it seems it is not the case.
>
> > What do I do wrong?
>
>
>
> Did you remember to reload Postgres?
>
YES I did it this time
>
>
>
> >
>
> > Thank you for help.
>
> >
>
> >
>
> >
>
>
>
>
>
> --
>
> Adrian Klaver
>
> adrian(dot)klaver(at)aklaver(dot)com
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2016-10-11 14:08:27 | Re: confusion about user paring with pg_hba and pg_ident |
Previous Message | Tom Lane | 2016-10-11 13:46:13 | Re: Create recursive view schema.name |