This article will show you how to execute SQL statements against your newly restored database using the CLI, and not intended to be a guide on how to construct your Own SQL statements (Here is a good introduction to SQL in the PostgreSQL). Please note that writing, executing, and debugging custom SQL statements is not supported by Jive Software.
- Use the
psqlcommand to connect to your database. (More information about this command in here).
psql -h localhost -p 5432 -U postgress testdb
psqlis the name of the command we are using.
-hoption is the name of the host, which should be localhost for default installs.
-poption is the name of the port, which should be localhost for default installs.
-Uoption is the name of the user to connect as, which should be postgress.
testdbis the name of the database to connect to. Replace this with the name of the database you restored your dump to.
You should be able to execute SQL statements directly in the command line.