Skip to content

Connecting to PostgreSQL using the command line

PostgreSQL provides a powerful interactive terminal called psql that allows you to connect to databases, run queries, and manage your data directly from the command line. On ruachost.com, you can use this method to quickly access and administer your PostgreSQL databases.

  • Fast and direct access to your database.
  • Ability to run SQL queries and administrative commands.
  • Useful for scripting and automation.
  • Essential for troubleshooting and advanced database management.
  • Use SSH to connect to your hosting account:
Terminal window
ssh username@yourserver.ruachost.com
  • At the command line, type:

    Terminal window
    psql dbname username
  • Replace dbname with the name of your database.

  • Replace username with your PostgreSQL username.

  • At the password prompt, type the database user’s password.
  • If correct, the psql prompt will appear.