Postgres for Mac OS X

On Mac OS X you can use Postgres.app to install and use PostgreSQL. It really is the easiest way to get started with PostgreSQL on the Mac!

Installation

  1. Download from website
  2. Drag’n’Drop into /Applications folder
  3. Start Postgres.app

Configuration

The app also provides additional command-line tools (e.q. psql). To use these tools, you need to add the directory to the path.

# create .bash_profile in home directory (if not exists)
$ touch ~/.bash_profile

# add directory path 
$ vim ~/.bash_profile
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin

Finish

Now you can use it! If you want to use tools like pgAdmin, just connect without password.

PyCharm Community Edition and Database Navigator

For the Community Editition there is a plugin that allows to edit or query databases directly from PyCharm. Currently MySQL, Oracle and Postgres are supported. The benefit, You as a tester (or developer) need to use no other tools.

Preparation

  • PyCharm is installed
  • Running Postgres server
  • Download latest JDBC driver (PostgreSQL)

Instructions

Search and install the “Database Navigator”. Restart PyCharm after installation.

PyCharm Database Navigator

Setup the connection. The following example shows a connection to Postgres.

Postgres connection

Insert all needed values. As driver library select the JDBC jar file. The URL should follow the syntax like:

jdbc:postgresql://host:port/database

To verify your settings, use the test button.

Now you can query, just select the schema and insert your SQL statements.

Database Navigator usage