I share real-world lessons from building scalable systems at Jump Trading, Binance, and running mission-critical cloud ops at GovTech and Singapore Air Force. No fluff, just practical takeaways, hard-earned fixes, and deep dives that matter.
Obtain the Postgres Version using SELECT version();
Resolving PostgreSQL pg_dump server version mismatch
The newer version of Postgres isnβt included in a lot of the Package Manager, you need to add the package repository in manually! You can find many online tutorials on this, here is one for APT package manager.
On MacOs, you can install with brew install postgresql@<version_number>. In order to use the new version, you have to brew unlink postgresql@<old_version>, then brew link --force postgresql@<new_version>.
-- 1) Create DB and login roleCREATE DATABASE new_db_name;CREATE USER new_db_username WITH PASSWORD 'new_db_user_password';-- 2) Give the user the right to connect/create temp schemas in the DBGRANT ALL PRIVILEGES ON DATABASE new_db_name TO new_db_username;-- (equivalent to CONNECT, CREATE, TEMP on the database)-- 3) Create a dedicated schema owned by the app user\c new_db_nameCREATE SCHEMA IF NOT EXISTS new_schema_name AUTHORIZATION new_db_username;-- 4) Prefer setting search_path on the role (not DB-wide)ALTER ROLE new_db_username SET search_path = new_schema_name, public;-- 5) Ensure the user can use the schema and access objectsGRANT USAGE ON SCHEMA new_schema_name TO new_db_username;