Appliquer la notion
Question
Installer PostgreSQL.
Solution
1
apt-get update
2
apt install postgresql
1
Reading package lists... Done
2
Building dependency tree
3
Reading state information... Done
4
Suggested packages:
5
postgresql-doc
6
The following NEW packages will be installed:
7
postgresql
8
0 upgraded, 1 newly installed, 0 to remove and 93 not upgraded.
9
Need to get 5,392 B of archives.
10
After this operation, 59.4 kB of additional disk space will be used.
11
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql
12
all 9.5+173ubuntu0.3 [5,392 B]
13
Fetched 5,392 B in 0s (120 kB/s)
14
debconf: delaying package configuration, since apt-utils is not installed
15
Selecting previously unselected package postgresql.
16
(Reading database ... 30282 files and directories currently installed.)
17
Preparing to unpack .../postgresql_9.5+173ubuntu0.3_all.deb ...
18
Unpacking postgresql (9.5+173ubuntu0.3) ...
19
Setting up postgresql (9.5+173ubuntu0.3) ...
20
21
Question
Comment obtenir des informations sur le statut du service PostgreSQL ?
Solution
1
systemctl status postgresql
1
● postgresql.service - PostgreSQL RDBMS
2
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
3
Active: active (exited) since Wed 2020-05-06 12:11:15 UTC; 2s ago
4
Process: 6194 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
5
Main PID: 6194 (code=exited, status=0/SUCCESS)
Le service est bien chargé dans le système (Loaded: loaded
) et il est bien actif (Active: active
).