Home Logic Ubuntu (Linux) Blog

BocaJS: NodeJS + Postgres

NPM Install: pg

$ npm install pg

We need pg to use PostgreSQL with NodeJS. Check out the documentation: pg npm

psql: Create Database

Next let's create a database for our application.


$ psql
candy=# CREATE DATABASE node_cms;

Now, connect to the database you just created.


candy=#  \c node_cms