To find the version of Postgres when you can enter the SQL database, you would run this SQL command with no quotes: "SELECT version();"
In this situation you cannot enter the Postgres database (and therefore can run no SQL commands). You want to know more about the installation of Postgres to troubleshoot why you cannot enter it. How do you find the version of Postgresql that is installed?
For Debian/Ubuntu distributions of Linux, run:
dpkg -l | grep postgres
For CentOS/RedHat/Fedora distributions of Linux, run:
rpm -qa | grep postgres