There are two pieces of software that are involving in a database working

  • The database server, which holds all the data
  • The database client, which talks to the database and asks for specific data

Your database server is Postgres, and your client can be anything! psql if you’re on the command line, pg8000 if you’re in Python, or TablePlus if you’d like a graphical interface.

Setting up your nice installs

OS X

If you’re on OS X, you need to run Postgres.app for your database server to be running.

Click the elephant icon, then Open Postgres to check that it’s doing okay.

If your Postgres window looks like this below (empty! no databases!) click initialize on the right-hand side.

When things are set up okay, you should have a few databases there (although maybe not the same as mine)

Windows

You downloaded “real” Postgres for Windows, so your database server should be running automatically.

psql - the command-line client - is installed and works fine from the Start Menu, but let’s add it to Cmder, too.

Using Windows Explorer, browse to C:\Program Files\PostgreSQL\11\bin\ (or 10\bin if you’re using version 10). Right-click where it says bin up top and select Copy address.

Open Cmder, then go into the Settings.

Cmder doesn’t know where to find psql, so we need to tell it to also look in C:\Program Files\PostgreSQL\11\bin\.

Click Startup > Environment., and add a new line that says

set PATH=C:\Program Files\PostgreSQL\11\bin\;%PATH%

This adds that folder to the PATH, the list of places Cmder looks for programs to run. You can use paste, just in case your Program Files folder is on D:\ instead of C:\ or something like that.

Click Save settings, then restart Cmder.

Log in as the default postgres user like this:

psql -U postgres

And you’ll be all set! (hopefully you remembered your password)