I successfully installed a postgresql 12 database on my Ubuntu. The problem is at reboot.I can't access postgresql from remote computer until I restart the cluster with
sudo systemctl restart postgresql@12-main
The state before restart is:
● postgresql@12-main.service - PostgreSQL Cluster 12-main Loaded: loaded (/lib/systemd/system/postgresql@.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2024-07-11 09:32:29 UTC; 2min 7s ago Process: 1157 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 12-main start (code=exited, status=0/SUCCESS) Main PID: 1258 (postgres) Tasks: 7 (limit: 1015) Memory: 37.3M CGroup: /system.slice/system-postgresql.slice/postgresql@12-main.service├─1258 /usr/lib/postgresql/12/bin/postgres -D /var/lib/postgresql/12/main -c config_file=/etc/postgresql/12/main/postgresql.conf├─1261 postgres: 12/main: checkpointer├─1262 postgres: 12/main: background writer├─1263 postgres: 12/main: walwriter├─1264 postgres: 12/main: autovacuum launcher├─1265 postgres: 12/main: stats collector└─1266 postgres: 12/main: logical replication launcherJul 11 09:32:23 orangepilite2 systemd[1]: Starting PostgreSQL Cluster 12-main...Jul 11 09:32:29 orangepilite2 systemd[1]: Started PostgreSQL Cluster 12-main.
Local login allowed before restart:
orangepi@orangepilite2:~$ sudo -u postgres psqlpsql (12.19 (Ubuntu 12.19-0ubuntu0.20.04.1))Type "help" for help.postgres=#