Postgresql

Notes

Setup for new Apps

Assuming a postgres instance is already running and a new app is being setup that requires a database in it.

  1. Create a new role (/password)
  2. Create a new database for app
  3. Restrict acess for the role to that database
# CREATE DATABASE <database>;
# CREATE USER <user> WITH ENCRYPTED PASSWORD '<pass>';
# ALTER DATABASE <database> OWNER TO <user>;
# GRANT ALL PRIVILEGES ON DATABASE <database> TO <user>;

Use this connection string for access: postgres://<user>:<pass>@<host>:<port>/<database>