BUG #17381: psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" After installing

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: poudelpratik97(at)gmail(dot)com
Subject: BUG #17381: psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" After installing
Date: 2022-01-25 02:28:19
Message-ID: 17381-1ef30f3b252fb937@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17381
Logged by: Pratik Poudel
Email address: poudelpratik97(at)gmail(dot)com
PostgreSQL version: 14.0
Operating system: Linux- Ubuntu
Description:

Hello,
I tried to install postgresql on Ubuntu 20 LTS.
I followed digital oceans docs and used the following for the
installation::
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

This installed successfully when I tried to switch to postgres account
using
sudo su - postgres
The above worked.
But it throws the error when i try the command "psql"

psql: error: connection to server on socket
"/var/run/postgresql/.s.PGSQL.5432"
failed: No such file or directory
Is the server running locally and accepting connections on that socket?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Matti Linnanvuori 2022-01-25 11:38:00 Re: BUG #17381: psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" After installing
Previous Message Tom Lane 2022-01-24 19:00:11 Re: BUG #17379: Cannot issue multi-command statements using a replication connection