POSTGRES INSTALLATION
-
terminal -> brew install postgresql pay attention to the caveats section of the install
-
Once installation is complete, create a database: initdb /usr/local/var/postgres -E utf8
-
To startup the postgres server, open a new tab in terminal and: command -> postgres -D /usr/local/var/postgres
-
You should see something like this: LOG: database system is ready to accept connections LOG: autovacuum launcher started
-
Now that the server is up, open up a new tab and create a new database: terminal -> creatdb databaseNameGoesHere;
-
To access the database: terminal -> psql databaseNameGoesHere;
-
To have your server communicate with your postgres server, edit the database.js in the var knex = require to match the user, password, and database name that you specified.
-
If you do not have a user and password, you can create one in the same tab that you are logged into the database (not the server tab) terminal -> CREATE ROLE usernameGoesHere with login password 'passwordGoesHere';//(need quotes for password)