Showing the "database" doesn't (normally) work with libpq / pgsql... # sudo -u zabbix psql "host=/var/run/postgresql user=zabbix dbname=" -c 'select 1' ?column? ---------- 1 # sudo -u zabbix psql "host=/var/run/postgresql user=zabbix database=" -c 'select 1' psql: invalid connection option "database" If the socket file is not there... Connection failed: failed to connect to `host=/var/run/postgresql user=zabbix database=postgres`: dial error (dial unix /var/run/postg resql/.s.PGSQL.5432: connect: no such file or directory).