Overview
Once you have restored the database download via CLI (see the Related Articles section for reference articles), you can use this article for step-by-step instructions on how to query the database via CLI.
This section demonstrates you how to execute SQL statements against your newly restored database, and is not intended to be a guide on how to construct your own SQL statements.
You can refer to PostgreSQL: Documentation: 9.2: The SQL Language for an excellent introduction to SQL.
NOTE: Jive Software does not support writing, executing, and debugging custom SQL statements.
Environment
- This article covers all versions of Jive Custom.
- The commands in this article (and cross-reference articles) were written using PostgreSQL version 9.2.6
- This guide was written for the Mac OSX release of Postgres/pgAdmin; however, the steps should translate to Windows or Linux.
Process
- Use the psql command to connect to your database:
test.user$ psql -h localhost -p 1111 -U postgres testdb
psqlis the name of the command we are running.
- the
-hoption is the name of the host, which should belocalhostfor default installs.
- the
-poption is the name of the port, which should be1111for default installs.
- the
-Uoption is the name of the user to connect as, which should be Postgres.
testdbis the name of the database to connect to. Replace this with the name of the database you restored your dump to.
- You can now execute SQL statements directly in the command line.
Priyanka Bhotika
Comments