Postgresql is a server running locally and accepting connections in a Unix domain.

I am trying to install postgresql-9.5 or postgresql-9.6 on my ubuntu computer 16.04or 14.04after completing the installation process with the following commands.

sudo apt-get install update
sudo apt-get install postgresql postgresql-contrib

But when I try to open psqlfrom my terminal using below commands

sudo su postgres 
psql 

every time it is just displayed.

psql: cannot connect to server: no such file or directory. is the server running locally and accepts connections in the Unix socket domain "/var/run/postgresql/.s.PGSQL.5432"?

I tried about 10 stackoverflow.com solutions but did not succeed. Please help me before I rip all my hair :(

$ postgresql service status

 postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor prese
   Active: active (**exited) since রবি 2017-03-12 21:45:56 BDT; 23min ago
  Process: 917 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 917 (code=exited, status=0/SUCCESS)
    Tasks: 0
   Memory: 0B
      CPU: 0
   CGroup: /system.slice/postgresql.service

, ? : () রবি 2017-03-12 21:45:56 BDT; 23

+4
2

, , postgresql:

service postgresql status

PostgreSQL , :

service postgresql start
service postgresql status

, , :

tail /var/log/postgresql/postgresql-9.6-main.log

, createdb (. https://www.postgresql.org/docs/current/static/app-createdb.html):

createdb demo

PostgreSQL , service postgresql status, , , PostgreSQL 5432 :

netstat -na | grep postgres

2

debian/ubuntu PostgreSQL , : https://www.gab.lc/articles/install_postgresql_9-5_debian_ubuntu ( 9-2 9-6).

+10

postgresql

sudo apt-get --purge remove postgresql-*
sudo rm -Rf /etc/postgresql /var/lib/postgresql
sudo apt-get install postgresql
+2

Source: https://habr.com/ru/post/1672102/


All Articles