To download the program to your personal computer, see here.
To Connect to the DB:
- Open pgAdmin
- File -> Add server
- Properties defined as follows:
- Name: pvsadmin
- Host: ord0.votesmart.org
- Port: 5432
- Maintenance DB: pvsadmin
- Username: staff
- Password: xxxxxxx (you should receive this during your training)
- Click “Ok”
The server should then be available under “Servers” on the lefthand Object browser. This browser contains the names of servers, databases, and objects within those databases. For Research purposes, the relevant database is pvsadmin. The relevant objects are:
- The public schema (under “Schemas”)
- The tables under “Tables”
The server may disconnect during use; if this happens, click the “reconnect” option when prompted.
To Open a Table:
- Right click on a table
- Click “View Data”
- You will likely only need to view the first/last 100 rows, which will help with performance.
To Run Queries:
- Click on “pvsadmin” under Databases
- Click on “public” under Schemas
- Click the magnifying glass w/ “SQL” logo in the secondary menu (“Execute arbitrary SQL queries”, because what you’re doing is likely arbitrary (jokes))
- This brings up an editor. You can write in the large field in the middle.
- Execute/run queries via the green play button on the secondary menu.
- The output will, by default, appear at the bottom of the screen
To Save Queries:
- From the module, “File” -> Save as -> “Query (text)”
- Save in the appropriate folder.
This will save the query as a plain text file. This can be very useful to saving queries in common locations under the Research Program folders for sharing purposes.
To Open Queries:
- From the editor module, “File” -> “Open”
- Locate the correct folder where a query is saved
- Change to search for “All files” on the menu above “Open”
- Open the file.
This method can open any plain text file.
This is why it is best to save queries as a plain text file. Note that many already live in the Research drive in “Queries” folders under the appropriate programs.
To Save CSVs of Output:
- In the editor module, select the “Query” menu from the top.
- Select “Execute to file”
Open a CSV using LibreOffice Calc.