It seems possible postgres is somehow configured to use a non-standard port.
Try
ls -al /var/discourse/shared/standalone/postgres_run
On my installation, I see
total 28
drwxrwxr-x 5 systemd-resolve input 4096 Jan 26 15:43 .
drwxr-xr-x 13 root root 4096 Jan 27 2021 ..
drwxr-x--- 2 lxd mlocate 4096 Jun 8 2020 10-main.pg_stat_tmp
drwxr-x--- 2 lxd mlocate 4096 Jan 27 2021 12-main.pg_stat_tmp
drwxr-xr-x 2 systemd-resolve input 4096 Mar 14 15:06 13-main.pg_stat_tmp
-rw-r--r-- 1 systemd-resolve input 4 Jan 26 15:43 13-main.pid
srwxrwxrwx 1 systemd-resolve input 0 Mar 14 15:06 .s.PGSQL.5432
-rw------- 1 systemd-resolve input 62 Mar 14 15:06 .s.PGSQL.5432.lock