Postgresql is dead + more

updated log after having solved this issue.

:~$ sudo yunohost service log postgresql
/var/log/postgresql/postgresql-13-main.log: 
  - 2022-10-01 08:55:27.343 CEST [135943] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(semi.social, HVykjHcfdtlQfBcqfMimMlIp) already exists.
  - 2022-10-01 08:55:27.343 CEST [135943] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('semi.social', 'HVykjHcfdtlQfBcqfMimMlIp', 'image/png', 1411740, 1664607327342, 'Pixel Oliver - Medusa.png', 'pALKLczonRWiJzKXQXJDEbXE', 1664607327342)
  - 2022-10-01 08:55:27.392 CEST [135943] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.392 CEST [135943] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, PMWEwHRbOpwllkWcCmpuyxpz) already exists.
  - 2022-10-01 08:55:27.392 CEST [135943] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'PMWEwHRbOpwllkWcCmpuyxpz', 'image/jpeg', 20355, 1664607327391, 'IMG_20210416_084346_e_1618555512898.jpg', 'EfatNrIvwplpvECJjdRazOkD', 1664607327391)
  - 2022-10-01 08:55:27.462 CEST [135945] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.462 CEST [135945] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, PMWEwHRbOpwllkWcCmpuyxpz) already exists.
  - 2022-10-01 08:55:27.462 CEST [135945] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'PMWEwHRbOpwllkWcCmpuyxpz', 'image/jpeg', 20355, 1664607327460, 'IMG_20210416_084346_e_1618555512898.jpg', 'NDqgXMNRdYSTuMGifoiAYzkB', 1664607327460)
  - 2022-10-01 08:55:27.616 CEST [135974] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.616 CEST [135974] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(autonomic.zone, BihZxEafuxzwMOPptsQrINkn) already exists.
  - 2022-10-01 08:55:27.616 CEST [135974] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('autonomic.zone', 'BihZxEafuxzwMOPptsQrINkn', 'image/jpeg', 44976, 1664607327615, 'socialsalior.jpg', 'MpdKNBvkQcErMXJorreJAyZf', 1664607327615)
  - 2022-10-01 08:55:27.672 CEST [135945] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.672 CEST [135945] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, uMwYEJCrzFZbDpmFgUdHDnvw) already exists.
  - 2022-10-01 08:55:27.672 CEST [135945] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'uMwYEJCrzFZbDpmFgUdHDnvw', 'image/png', 311416, 1664607327671, 'puffinux_psychadelic_simple.png', 'rMjAPsMRPJlkMjchiWAIpSTG', 1664607327671)
  - 2022-10-01 08:55:27.755 CEST [135974] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.755 CEST [135974] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, tdFWvVBvBFOCvmrzcFmnlZqW) already exists.
  - 2022-10-01 08:55:27.755 CEST [135974] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'tdFWvVBvBFOCvmrzcFmnlZqW', 'image/png', 6039, 1664607327754, '280f27c808db6f39.png', 'tzrHcArabNKskQkloXhwpzlh', 1664607327754)
  - 2022-10-01 08:55:27.935 CEST [135976] matrix_synapse@matrix_synapse ERROR:  duplicate key value violates unique constraint "remote_media_cache_media_origin_media_id_key"
  - 2022-10-01 08:55:27.935 CEST [135976] matrix_synapse@matrix_synapse DETAIL:  Key (media_origin, media_id)=(matrix.org, PMWEwHRbOpwllkWcCmpuyxpz) already exists.
  - 2022-10-01 08:55:27.935 CEST [135976] matrix_synapse@matrix_synapse STATEMENT:  INSERT INTO remote_media_cache (media_origin, media_id, media_type, media_length, created_ts, upload_name, filesystem_id, last_access_ts) VALUES('matrix.org', 'PMWEwHRbOpwllkWcCmpuyxpz', 'image/jpeg', 20355, 1664607327934, 'IMG_20210416_084346_e_1618555512898.jpg', 'ejpvswMgrRaDvzaXrPMxscAQ', 1664607327934)
  - 2022-10-03 13:06:02.866 CEST [135910] LOG:  received fast shutdown request
  - 2022-10-03 13:06:02.902 CEST [135910] LOG:  aborting any active transactions
  - 2022-10-03 13:06:02.907 CEST [135910] LOG:  background worker "logical replication launcher" (PID 135917) exited with exit code 1
  - 2022-10-03 13:06:02.947 CEST [155405] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 13:06:02.947 CEST [155546] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 13:06:02.947 CEST [165989] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 13:06:02.991 CEST [135912] LOG:  shutting down
  - 2022-10-03 13:06:03.108 CEST [135910] LOG:  database system is shut down
  - 2022-10-03 13:06:03.416 CEST [211884] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-10-03 13:06:03.417 CEST [211884] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-10-03 13:06:03.417 CEST [211884] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-10-03 13:06:03.418 CEST [211884] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-10-03 13:06:03.433 CEST [211885] LOG:  database system was shut down at 2022-10-03 13:06:03 CEST
  - 2022-10-03 13:06:03.523 CEST [211884] LOG:  database system is ready to accept connections
  - 2022-10-03 19:05:44.230 CEST [211884] LOG:  received SIGHUP, reloading configuration files
  - 2022-10-03 19:05:48.751 CEST [222313] postgres@postgres ERROR:  database "dendrite" already exists
  - 2022-10-03 19:05:48.751 CEST [222313] postgres@postgres STATEMENT:  CREATE DATABASE dendrite ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER dendrite;
  - 2022-10-03 21:46:29.045 CEST [211884] LOG:  received fast shutdown request
  - 2022-10-03 21:46:29.127 CEST [211884] LOG:  aborting any active transactions
  - 2022-10-03 21:46:29.133 CEST [211884] LOG:  background worker "logical replication launcher" (PID 211891) exited with exit code 1
  - 2022-10-03 21:46:29.142 CEST [237196] dendrite@dendrite FATAL:  terminating connection due to administrator command
  - 2022-10-03 21:46:29.142 CEST [212273] gotosocial@gotosocial FATAL:  terminating connection due to administrator command
  - 2022-10-03 21:46:29.146 CEST [211886] LOG:  shutting down
  - 2022-10-03 21:46:29.298 CEST [211884] LOG:  database system is shut down
  - 2022-10-03 21:46:29.654 CEST [240539] LOG:  starting PostgreSQL 13.8 (Debian 13.8-0+deb11u1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
  - 2022-10-03 21:46:29.655 CEST [240539] LOG:  listening on IPv6 address "::1", port 5432
  - 2022-10-03 21:46:29.655 CEST [240539] LOG:  listening on IPv4 address "127.0.0.1", port 5432
  - 2022-10-03 21:46:29.665 CEST [240539] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  - 2022-10-03 21:46:29.719 CEST [240540] LOG:  database system was shut down at 2022-10-03 21:46:29 CEST
  - 2022-10-03 21:46:29.796 CEST [240539] LOG:  database system is ready to accept connections
journalctl: 
  - -- Journal begins at Thu 2022-09-15 00:26:29 CEST, ends at Mon 2022-10-03 21:46:39 CEST. --
  - Sep 18 18:56:59 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 18:57:02 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 18:57:02 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 18:57:02 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 18:57:10 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:06:13 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 19:06:13 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 19:06:13 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 19:06:13 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 19:06:16 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:37:10 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 18 19:37:11 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 18 19:37:11 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 18 19:37:11 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 18 19:37:15 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 18 19:51:41 systemd[1]: Reloading PostgreSQL Cluster 11-main.
  - Sep 18 19:51:41 systemd[1]: Reloaded PostgreSQL Cluster 11-main.
  - -- Boot 09c6bc504c524e05bdc65fd6bd7462e3 --
  - Sep 19 18:19:12 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 19 18:19:14 postgresql@11-main[686]: Removed stale pid file.
  - Sep 19 18:19:26 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 19 18:31:26 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 19 18:31:26 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 19 18:31:26 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 19 18:31:26 systemd[1]: postgresql@11-main.service: Consumed 1.937s CPU time.
  - -- Boot ee0e86dc619042259065dc271e150806 --
  - Sep 19 18:32:11 systemd[1]: Starting PostgreSQL Cluster 11-main...
  - Sep 19 18:32:20 systemd[1]: Started PostgreSQL Cluster 11-main.
  - Sep 19 18:41:56 systemd[1]: Stopping PostgreSQL Cluster 11-main...
  - Sep 19 18:41:57 systemd[1]: postgresql@11-main.service: Succeeded.
  - Sep 19 18:41:57 systemd[1]: Stopped PostgreSQL Cluster 11-main.
  - Sep 19 18:41:57 systemd[1]: postgresql@11-main.service: Consumed 1.559s CPU time.