1.postgresにログイン
$ psql postgres-db


Welcome to psql 8.0.4, 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


2.SQL実行
postgres-db=# SELECT version(); ←これを実行
version

                                                                                                                                                                                                    • -

PostgreSQL 8.0.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.0.0 20050519 (Red Hat 4.0.0-8)
(1 row)