Postgres failing to start with "LOG: could not translate host name "localhost", service "5432" to address: Name or service not known"

Solution Verified - Updated -

Issue

Postgres service fails to start showing error messages:

LOG:  starting PostgreSQL 12.11 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
LOG:  could not translate host name "localhost", service "5432" to address: Name or service not known
WARNING:  could not create listen socket for "localhost"
systemd[1]: rh-postgresql12-postgresql.service: main process exited, code=exited, status=1/FAILURE

Environment

  • Red Hat Enterprise Linux Server 7.x
  • Red Hat Enterprise Linux Server 8.x
  • Red Hat Satellite 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content