- MySQL Closure Table
Sometimes we are given a task where we need to model a hierarchy of different complexity levels and not really sure how to do that properly in the most efficient, reliable, and flexible way. Let’s review one of the data modeling patterns that give us some answers for that. Consider we have a…
- Postgres – Databases, Schemas, Roles and Privileges
A database holds schemas, a schema holds tables, and a role is both a user and a group. Creating an application account that is not a superuser: what `public` grants you by default and why the first thing to do is revoke it, GRANT versus ALTER DEFAULT PRIVILEGES and why the second one is the one people forget, search_path, and the owner/app/read-only split worth having on day one.
- Postgres – psql and the Tools You Actually Use
psql is the tool that ships with the database and the one every answer online assumes. The meta-commands worth memorising — \d, \d+, \di, \l, \dn, \x, \timing — the connection URI in full, running a file with ON_ERROR_STOP so a migration does not half-apply, and a .psqlrc that makes the shell bearable. Plus where a GUI still wins.
- Intellij Hot Keys
Reformat Code For Mac ⌥ ⌘ L command + option + l View Structure/Outline of Class command + 7
- Postgres – Install and Connect
Postgres 16 in a container in one command, then the same thing done properly: a docker-compose file with a named volume, a healthcheck that waits for the database rather than the process, and an init script. Why the published port is the one that enforces a password and the container socket is not, what happens to your data on `down -v`, and how to connect from psql, a URI and an app.