user@ubuntu:~$ postgres --version
Command 'postgres' not found, did you mean:
command 'postgrey' from deb postgrey
Try: sudo apt install <deb name>
Проверил пакеты:
user@ubuntu:~$ apt list --installed | grep postgres
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
postgresql/bionic-pgdg,bionic-pgdg,now 12+210.pgdg18.04+1 all [installed]
postgresql-10/bionic-pgdg,now 10.11-1.pgdg18.04+1 amd64 [installed]
postgresql-12/bionic-pgdg,now 12.1-1.pgdg18.04+1 amd64 [installed,automatic]
postgresql-client-10/bionic-pgdg,now 10.11-1.pgdg18.04+1 amd64 [installed]
postgresql-client-12/bionic-pgdg,now 12.1-1.pgdg18.04+1 amd64 [installed,automatic]
postgresql-client-common/bionic-pgdg,bionic-pgdg,now 210.pgdg18.04+1 all [installed,automatic]
postgresql-common/bionic-pgdg,bionic-pgdg,now 210.pgdg18.04+1 all [installed,automatic]
Пользователь добавил сообщение 13 Января 2020, 19:48:21:
Статус:
user@ubuntu:~$ service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2020-01-13 19:16:33 MSK; 21min ago
Process: 1491 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 1491 (code=exited, status=0/SUCCESS)
янв 13 19:16:33 ubuntu systemd[1]: Starting PostgreSQL RDBMS...
янв 13 19:16:33 ubuntu systemd[1]: Started PostgreSQL RDBMS.
Логи говорят:
2020-01-13 19:16:31.164 MSK [1344] LOG: starting PostgreSQL 12.1 (Ubuntu 12.1-1.pgdg18.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.4.0-1ubuntu1~
18.04.1) 7.4.0, 64-bit
2020-01-13 19:16:31.165 MSK [1344] LOG: listening on IPv4 address "0.0.0.0", port 5433
2020-01-13 19:16:31.165 MSK [1344] LOG: listening on IPv6 address "::", port 5433
2020-01-13 19:16:31.169 MSK [1344] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5433"
2020-01-13 19:16:31.199 MSK [1351] LOG: database system was shut down at 2020-01-13 19:15:37 MSK
2020-01-13 19:16:31.208 MSK [1344] LOG: database system is ready to accept connections
Пользователь добавил сообщение 13 Января 2020, 20:36:41:
Еще инфа:
user@ubuntu:~$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
10 main 5433 down postgres /var/lib/postgresql/10/main pg_log/postgresql-%a.log
12 main 5432 online postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log