There are many options to install Postgres. Here we use “homebrew” (brew.sh). How to: Install Postgres on Mac with brew GOTCHA: “Wait, I just installed an older Postgres version(postgresql@14)? If you don’t specify a Postgres version, it downloads a default version that might not be the newest version or an older target version. How to:…
All posts in databases
Node Sequelize Postgres Tutorial
Why use Sequelize? Sometimes you want your team to use an ORM. Often you need to run migrations. Sequelize provides ORM features and a much needed migrations library that allows us to create producible and version controlled database schemas. Setup your project Step 1: Create an npm project in your desired directory $ npm init…
Postgres timestamp with timezone – “timestamptz”
Postgres can store your “timestamp with timezone” or “timestamp without timezone”.If you don’t specify either, it will default to “timestamp without timezone” Which one should you use? TLDR: “timestamps with time zones” Whats the problem living life without timezones? Say you have two users in two different timezones – one in California and one in…
Postgres tutorial – installing with brew + basics (old)
Updated and vastly improved version (July 8th 2024): link Step 1: Install postgres brew install postgres Step 2: Start postgres server brew services start postgresql Step 3: Create a database Lets call our database “book” $ createdb book Step 4: open the psql shell List all databases in terminal with: $ psql –list Adding the…