We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out of the box, this image does not allow me to run psql commands by using the -U parameter to pass the username. Repro steps and output below:
-U
root@751e37ecfac7:/# sudo service postgresql start * Starting PostgreSQL 9.4 database server [ OK ] root@751e37ecfac7:/# psql -c "create database foo" -U postgres psql: FATAL: Peer authentication failed for user "postgres"
Currently, the only way out is to run psql after switching to the postgres user like this:
root@751e37ecfac7:/# sudo su postgres -c 'psql -c "create database foo"' CREATE DATABASE root@751e37ecfac7:/#
This works, but it's rather inelegant.
This can be fixed by updating /etc/postgresql/9.4/main/pg_hba.conf to change this line:
/etc/postgresql/9.4/main/pg_hba.conf
local all postgres peer
to
local all postgres trust
The text was updated successfully, but these errors were encountered:
spsiddarthan
No branches or pull requests
Out of the box, this image does not allow me to run psql commands by using the
-U
parameter to pass the username. Repro steps and output below:Currently, the only way out is to run psql after switching to the postgres user like this:
This works, but it's rather inelegant.
This can be fixed by updating
/etc/postgresql/9.4/main/pg_hba.conf
to change this line:to
The text was updated successfully, but these errors were encountered: