Postgres Adventures Journal

Everything started at the dawn of October 2025. I was looking for whatever lies beyond the limits of Redis and Sqlite, in the foreign land of Proper Database Systems™. Then I remembered. A few years ago... The signs... I ignored them... Some strange symbols, strange words. “ORM”. At that point I am already unconscious, the letters flashing behind my retina. “We’ve moved to MongoSQL, it’s easier to manage”. My body crumbles further, it may be too late to save me. “I’ve upgraded from MySQL to MariaDB, it’s more modern.” As my body enters a critical state, my mind drifts afar from the chaos, leaving what’s left of me dreaming of a world where data just floats freely across the collective mind.

I woke up to a freshly setup Podman Machine. A single line of command would kick off the journey to PDS™ Land.

podman run --rm -e POSTGRES_PASSWORD=dev -e POSTGRES_USER=dev -p 5432:5432 postgres:alpine

I tried to find something equally easy to send a message to 5432.

According to my first attempt at researching this, the solution was to install some Python command line tool.

virtualenv .; source bin/activate pip install pgcli pgcli -h localhost -p 5432 -u dev

Obviously this crashes, because pgcli wants libpq installed. I decided that I was fine with running brew install libpq.

pgcli still crashes, because even though libpq is there, pgcli can’t find it. Luckily, homebrew had some wisdom to share before breathing its last, breath.

libpq is keg-only, which means it was not symlinked into /opt/homebrew,
because it conflicts with PostgreSQL.

If you need to have libpq first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> /Users/tandreani/.bash_profile

For compilers to find libpq you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/libpq/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/libpq/include"

Let’s just put everything in bin/activate instead of polluting my carefully engineered bash configuration.

Running pgcli again... I’m in, I whisper.

As I type CREATE TABLE table () and press Enter, I can feel untouched streams of data starting to materialize around me. Then everything went dark. Looks like one container and libpq is more than enough to start experimenting with Postgres.