postgresのバージョンを調べる

ターミナルからならば、接続した際にすぐわかります

[hoge@hoge-dev]$ psql DB
Welcome to psql 8.3.8, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

SQL文からでも確認

DB=> select version();
                                                version
--------------------------------------------------------------------------------------------------------
 PostgreSQL 8.3.8 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)
(1 row)

MySQLでも同様にselect version()で確認できる