On Wed, Mar 11, 2020 at 11:54:55AM +0530, Ashim Kapoor wrote:
> I did this :-
>
> root@DSpace:~# psql --user dspace -d dspace -f
> /home/dspace/dspace-install/etc/postgres/update-sequences.sql
> psql: FATAL: Peer authentication failed for user "dspace"
> root@DSpace:~#
>
> Can you please correct me ?
This seems to mean that your PostgreSQL is configured to try 'peer'
authentication before password authentication.
https://www.postgresql.org/docs/current/auth-peer.html
You are logged in as 'root' so Pg is looking for an access rule for
the database user 'root', which probably does not exist.
Check pg_hba.conf. You probably want password authentication (md5 or
scram-sha-256) for DSpace itself, regardless of how you authenticate
with 'psql', and it definitely won't work with 'peer' because that
doesn't work on network sockets and the JDBC driver requires them.
https://www.postgresql.org/docs/current/auth-password.html
You may have trouble if you choose the 'scram-sha-256' authentication
method, unless your JDBC driver is quite recent -- for example,
version 42.2.1 works for me. The 'md5' method works with older or
newer drivers.