SUSE Support

Here When You Need Us

Peer authentication failed for user "postgres"

This document (000022003) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Manager Server 5.0.x


Situation

A connection attempt to PostgreSQL as the `postgres` user using `psql -U postgres` may fail with the following error.

uyuni-server:/ # psql -U postgres
psql: error: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "postgres"

Resolution

To access the PostgreSQL database (for example, `susemanager`), use the following command:

uyuni-server:~ # sudo -u postgres psql susemanager

Cause

The "Peer authentication failed" message occurs because PostgreSQL is configured to use peer authentication for local `postgres` users.

With peer authentication, the OS user needs to match the PostgreSQL user being connected. If the OS login user is not `postgres`, the connection attempt will fail.

To prevent this message from appearing, `sudo` can be used to switch to the `postgres` user.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000022003
  • Creation Date: 22-Aug-2025
  • Modified Date:26-Aug-2025
    • SUSE Manager Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.