PostgreSQL error on Raspberry Pi

Hi. I install Libretime on my raspberry pi only one error is up. But install finished correctly.

I using command ./install


          * Configuring PostgreSQL *              

Create default airtime postgres user? (Y/n): Y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = “en_US.UTF-8”,
LC_ALL = (unset),
LANG = “en_US.utf8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = “en_US.UTF-8”,
LC_ALL = (unset),
LANG = “en_US.utf8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
bash:(): ERROR: Can’t create airtime user in PostgreSQL!

I set locale to en_US.UTF-8. When I go to a web page then the page comes up in Database Settings and I have to enter data there. When I press “Next” I get this error message. What should I do to get to work?

Couldn’t establish a connection to the database! Please check your credentials and try again. PDO Exception: SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host “localhost” (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host “localhost” (127.0.0.1) and accepting TCP/IP connections on port 5432?

if i try again using ./install -fiap command, coming next error


          * Configuring PostgreSQL *              

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/run/postgresql/.s.PGSQL.5432”?
bash:(): ERROR: Can’t create airtime user in PostgreSQL!

Sounds like you need to look at your postgresql logs and verify it is running correctly. As I’m responding on my phone I can’t easily point to the various sites with info on how to do this but it shouldn’t be hard to find.

root@raspberrypi:/# service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Sat 2019-08-31 14:51:40 BST; 1h 3min ago
Main PID: 5221 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/postgresql.service

Aug 31 14:51:40 raspberrypi systemd[1]: Starting PostgreSQL RDBMS…
Aug 31 14:51:40 raspberrypi systemd[1]: Started PostgreSQL RDBMS.

And postgresql log folder is empty

root@raspberrypi:/var/log/postgresql# ls
root@raspberrypi:/var/log/postgresql#

One interesting thing if i use this command pg_lsclusters - i don’t see anything and /etc/postgresql/ folder is empty

root@raspberrypi:~# pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
root@raspberrypi:~#

PostgreSQL working some raspberry pi?

I install “sudo apt-get install postgresql”.

If i look Data files: /var/lib/postgresql/ this is empty
If i look Configuration files: /etc/postgresql/ this is empty

How can i install PostgreSQL to raspberry so that both Configuration and Data folders create files

This problem can’t just be mine, it must be a problem for many who install PostgreSQL on Raspberry Pi

If you are using Bionic, maybe this post might help?
https://discourse.libretime.org/t/getting-lt8-working-on-ubuntu-18-04-notes-postgres-solved/354

I found problem. PostgreSQL 9.6 not working Debian Stretch only 9.5. If i installed 9.5 PostgreSQL working correctly.