PostgreSQL
- data
- in current work
PostgreSQL is the database I keep coming back to. I first used it at Sifted, where the Companies Summary Generator tracked thousands of scraped companies through multi-step pipelines in it. LoS moved onto it later, when it outgrew SQLite and needed concurrent access from a phone and a web interface on my Raspberry Pi; since then it's been my default for nearly every project that needs a real database.
It's also under the Meeting Intelligence Platform, where it holds the meetings and their transcripts, and Gamers Career Matching, for player analytics. Each project pushed me deeper: window functions, materialized views, JSONB columns for semi-structured data.
What I appreciate most is that Postgres never feels like the bottleneck. It's quiet and dependable, and it just handles whatever you throw at it without drama. Not the most exciting endorsement, but for a database, that's exactly what you want.
/**
* Replace the live catalogue with the staging one. It's a couple of renames in one
* transaction: searches see either the old catalogue or the new one, never a mix.
*/
export async function swapStagingIn(client: pg.ClientBase) {
await client.query(`CREATE SCHEMA IF NOT EXISTS ${LIVE}`);
await client.query("BEGIN");
try {
await client.query(`DROP SCHEMA IF EXISTS ${LIVE}_old CASCADE`);
await client.query(`ALTER SCHEMA ${LIVE} RENAME TO ${LIVE}_old`);
await client.query(`ALTER SCHEMA ${STAGING} RENAME TO ${LIVE}`);
await client.query("COMMIT");
} catch (err) {
await client.query("ROLLBACK");
throw err;
}
await client.query(`DROP SCHEMA IF EXISTS ${LIVE}_old CASCADE`);
}