M
M
malkovan2021-02-02 18:52:02
PostgreSQL
malkovan, 2021-02-02 18:52:02

User UNIX + user pg + db pg = all different?

Firework! I killed a day , opened 1000 tabs in the browser
, nothing worked) I log in to

the server under test
User in pg - admin
Base in pg - first At the moment, I realized that you can create users of the same name for the server and pg and name the database the same way, then it should work. But I don't want to do that. It is necessary to make a connection with all the different ones. I also realized that I need to specify map in the pg_ident.conf file , I created a single line there:




example test admin

But with the indication of the necessary data in the pg_gba.conf file, I can not win.

On this server, the parser on the node will spin, and it will fill this database.
I'm not sure yet what authorization method to specify for it.

Please tell others!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Koryukov, 2021-02-02
@MadridianFox

Both the user and a DB can be specified at connection.
psql -U admin first

D
Dr. Bacon, 2021-02-02
@bacon

Usually, if you didn’t touch pg_ident.conf, then so, plus it will ask for a passwordpsql -U admin -h localhost first

M
malkovan, 2021-02-03
@malkovan

I specified one rule in the pg_ident.conf file :
// name - unix user - user pg
example test admin
In the pg_hba.conf file , I change two lines:
// the first one is for the local connection type, with the peer authentication method
// works correctly, the rule is applied
/ / check with local all all peer map=example // second one for connection type host , with ident authentication method // doesn't work, with the same rule // check with host all all localhost ident map=example // get an errorpsql -U admin


What could be the problem with this authentication method?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question