Problem with connection to external(on localhost) database postgresql 11.10 from Gitlab 13.x (Omnibus version)

Hello all

Postgresql version: 11.10 ( working on the same host as gitlab service)
Gitlab version: 13.5.3
Os: RedHat Enterprise 8.2

I have problem during configuration gitlab 13.5.3 to communication with external postgresql database. The problem appear when i execute command: gitlab-ctl reconfigure.

According to documentation:

  1. https://docs.gitlab.com/13.5/omnibus/settings/database.html#using-a-non-packaged-postgresql-database-management-server
  2. https://docs.gitlab.com/ee/administration/postgresql/external.html

As user postgres i created user: gitlab and gitlabhq_production in postgres database, but when i execute command: gitlab-ctl reconfigure, i have error like this one:

STDOUT: rake aborted!
PG::ConnectionBad: FATAL: Peer authentication failed for user “gitlab”

So i decide change value from ident on md5 in /var/lib/pgsql/11/data/pg_hba.conf i have error like this:

failed to execute:
psql -v ON_ERROR_STOP=1 -q -X -f /opt/gitlab/embedded/service/gitlab-rails/db/structure.sql gitlabhq_production

Please check the output above for any errors and make sure that psql is installed in your PATH and has proper permissions.

I don’t understand, all permissions look fine, any suggestion?