Re: Linux Users vs PostgreSQL Users - Mailing list pgsql-novice

From Michael Convey
Subject Re: Linux Users vs PostgreSQL Users
Date
Msg-id CACbnAKacByZTbb13L5CgjvwC_=nbKCcOXr4KHhJcfLB_49KoJw@mail.gmail.com
Whole thread Raw
In response to Re: Linux Users vs PostgreSQL Users  (Felipe Santos <felipepts@gmail.com>)
Responses Re: Linux Users vs PostgreSQL Users
List pgsql-novice
On Tue, Nov 10, 2015 at 10:59 AM, Felipe Santos <felipepts@gmail.com> wrote:
AFAIK there isn´t such a thing.

You are free to create users/roles/groups in Postgres without a match in the Linux system.

They are completely separate things, and you would only end up with the same OS users and DB users if you intended to do so by naming them equally, but still they are different kinds of objects, like cars and fruits.

For convenience and security, the POSTGRES OS user is usually created in the installation process and is related to the POSTGRES DB user by the configuration set in PG_HBA.CONF

On Tuesday, November 10, 2015 12:24:14 PM Alan Hodgson wrote:
> It is common, though, that distributions will setup PostgreSQL in such a way
> that it automatically trusts connections from identically named systems
> accounts via the Trust authentication method. You can change that in
> pg_hba.conf.

That should be the "ident" authentication method. "trust" trusts any account.  


​Thanks Alan & Felipe. So, in the following line, what does the last "postgres" do and is it necessary?

sudo -u postgres psql postgres


Wouldn't this be the same?

sudo -u postgres psql

pgsql-novice by date:

Previous
From: Alan Hodgson
Date:
Subject: Re: Linux Users vs PostgreSQL Users
Next
From: Alan Hodgson
Date:
Subject: Re: Linux Users vs PostgreSQL Users