Skip to content

Instantly share code, notes, and snippets.

View jgpruitt's full-sized avatar

John Pruitt jgpruitt

View GitHub Profile
@jgpruitt
jgpruitt / extension-from-scratch.md
Last active February 3, 2025 02:33
Postgres Extensions from Scratch

Postgres Extensions from Scratch

Setup

Run postgres in a docker container and get a shell into it.

docker pull postgres
docker run -d --name ext-demo --hostname ext-demo -e POSTGRES_HOST_AUTH_METHOD=trust -p 127.0.0.1:5432:5432 postgres
docker exec ext-demo /bin/bash -c "apt-get update && apt-get install -y vim"
@jgpruitt
jgpruitt / dynamic-sql.md
Last active January 31, 2025 21:23
SQL Macros a.k.a. Dynamic SQL