You can use the psql-wrapper script to connect to the TeamForge application database.
Run this script as below: