Running a PostgreSQL query

Queries are only able to run if there is a successful connection to the database. Type in your SQL query and press Cmd-E or the "Execute Query" button to run the query. In addition to the results being turned, the status line at the bottom of the screen will let you know how many records were returned. In the event the query was successful but returned no results (say from an update query), the status bar will let you know is was successful, but returned 0 rows.

PostMan Query has the ability to run queries in several of different ways. Multiple queries can be run if they are separated by a semicolon. If a query is highlighted (selected with the mouse), PostMan Query will only run the selected portion of the query window.


Run Selected Query
Running only the selected query

Running the entire query
 
Displaying table contents
PostMan Query makes it easy to view the contents of a table. Simply double-click on the database table name in the outline view on the left-hand side of the screen. This will automatically insert the correct query into the window and run the query. Note: Using this feature will erase the contents of the query window!

A new feature to PostMan Query is the ability to limit the query results returned without specifying a limit in the query itself. Simply enter a number in the Limit field to limit the results returned. This is especially handy when doing the above action and you just want to see a sample of the results without returning 50,000 records! If there is a limit inside of the query window, PostMan Query will use it instead of the limit supplied in the limit field.
 
Save Results
Saved Query Results Once there are results after a query, you can save them to a tab-delimited file. Press the "Save Results" button to save the results to a text file. Alternatively, if you desire to drop the text into Microsoft Excel, Click on the "Tab-Delimited" tab, select all the contents then drag into an open Microsoft Excel window. Since the results are tab-delimited, all the rows and columns will be correct in Excel.
 
Save SQL
Saved Query Document If you wish to save the SQL window, select "Save" from the menu. You will be prompted with the standard file save dialog box. Opening a file (save the files as a .sql) will populate the query window with the contents of the file. This is convenient when you wish to save a number of commands and reuse them later. Together with the ability for PostMan Query to run only the selected query, makes this a valuable feature.