Postgres Pain Points #3 postgres role

Started by support-tigerover 9 years ago3 messagesgeneral
Jump to latest
#1support-tiger
support@tigernassau.com

Relatively minor. All docs say to use "su - postgres" - it doesn't
seem to work right with linux. The difference in using the OS user
postgres and the postgres user (role) postgres is confusing. Even if we
set the postgres password to "postgres", it doesn't accept the
password. With linux we have found that "sudo -u postgres psql" works.
But not sure this is right or the best way.

--
Support Dept
Tiger Nassau, Inc.
www.tigernassau.com
406-624-9310

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: support-tiger (#1)
Re: Postgres Pain Points #3 postgres role

On 08/11/2016 10:15 AM, support-tiger wrote:

Relatively minor. All docs say to use "su - postgres" - it doesn't

You talking about this?:

https://www.postgresql.org/docs/9.5/static/install-short.html

That is building from source and shows creating an OS postgres user.

The only other thing I have seen is this:

https://help.ubuntu.com/community/PostgreSQL

and it shows:

sudo -u postgres psql postgres

seem to work right with linux. The difference in using the OS user
postgres and the postgres user (role) postgres is confusing. Even if we
set the postgres password to "postgres", it doesn't accept the
password. With linux we have found that "sudo -u postgres psql" works.
But not sure this is right or the best way.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: Adrian Klaver (#2)
Re: Postgres Pain Points #3 postgres role

On Thu, Aug 11, 2016 at 1:22 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

The only other thing I have seen is this:

https://help.ubuntu.com/community/PostgreSQL

and it shows:

sudo -u postgres psql postgres

​The second postgres redundant - the default database to connect to is the
name of the connecting user.

The relates back to your pg_hba.conf concern.

The default pg_hba.conf allows for the postgres user on the system to
connect, via the postgres user in the cluster, ​to the postgres database
that is created by default, using a UNIX socket. Among other possibilities
"sudo -u postgres" accomplishes the "for the postgres user on the system"
portion of the above. The rest of it is handled by defaults within the
psql application.

At this point you can connect as a superuser and setup whatever else you
require. This is the way Ubuntu means for PostgreSQL to be configured
initially - via the postgres O/S user on a local UNIX socket.

David J.