M
M
Muchacho2018-08-29 12:33:34
PostgreSQL
Muchacho, 2018-08-29 12:33:34

Why can't I select a user in PostgreSQL?

Hello. I created base, user and superuser. I can connect to the database, but only through the postgres user, but I can’t connect to the created user. Gives an error Peer authentication failed for user. Granted rights to the user. Maybe not all? How to connect to created database mydb through created user myuser?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Swartalf, 2018-08-29
@Swartalf

pg_hba.conf show + how you will connect to the database.

M
Melkij, 2018-08-29
@melkij

Gives an error Peer authentication failed for user.

Therefore, the first valid rule for authentication in pg_hba.conf is a string with a peer verification type - that is, the operating system user must have the same name as the requested database user.
You need to change your pg_hba and re-read the config. reload is enough.
How exactly to change - is determined by what kind of access restrictions you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question