PostgreSQL Hero
banner
postgresqlhero.bsky.social
PostgreSQL Hero
@postgresqlhero.bsky.social
Want to learn about PostgreSQL? You are in the good place!

🔗 https://postgresqlhero.vercel.app
Reposted by PostgreSQL Hero
Michael Stonebraker, the creator of PostgreSQL, also created Ingres.

Ingres was sold. Got acquired. Became proprietary.

So he made POSTGRES - to never let that happen again.

30+ years later, it's still free. Still community-owned. Still thriving. 🐘
December 5, 2025 at 9:34 AM
Reposted by PostgreSQL Hero
TIL: The PostgreSQL version numbering used to be X.Y.Z (like 9.6.24).

In 2017 they switched to X.Y (like 10.0, 11.0...).

Why? Because people kept thinking 9.5 and 9.6 were minor updates. They weren't - they were massive releases. 🐘
December 5, 2025 at 9:34 AM
Reposted by PostgreSQL Hero
TIL: Instagram ran on PostgreSQL when they were acquired by Facebook for $1 billion.

3 engineers. 30 million users. PostgreSQL.

They didn't need to 'scale to NoSQL'. Postgres handled it. 🐘📸
December 5, 2025 at 9:34 AM
Reposted by PostgreSQL Hero
TIL: PostgreSQL releases a new major version every year like clockwork.

They've done this since 2017. Every fall, a new major version drops.

No drama. No delays. Just consistent, boring reliability.

That's the elephant way. 🐘
December 5, 2025 at 9:33 AM
Reposted by PostgreSQL Hero
TIL: Apple ships PostgreSQL with every Mac.

It's been bundled with macOS since 10.7 Lion (2011).

Next time someone says 'I've never used Postgres' - if they have a Mac, they technically have. 🐘🍎
December 5, 2025 at 9:33 AM
Reposted by PostgreSQL Hero
TIL: PostgreSQL was the first database to implement MVCC (Multi-Version Concurrency Control).

This lets readers never block writers and writers never block readers.

Oracle later 'invented' the same thing. PostgreSQL had it in 1999. 🐘
December 5, 2025 at 9:33 AM
Reposted by PostgreSQL Hero
TIL: PostgreSQL is older than MySQL.

PostgreSQL: 1996
MySQL: 1995 (barely)

But POSTGRES (the project) started in 1986 - making the underlying technology a decade older.

The old elephant has seen things. 🐘
December 5, 2025 at 9:32 AM
Reposted by PostgreSQL Hero
TIL: PostgreSQL has been open source since 1996 and has NEVER been owned by a corporation.

It's maintained by a global community of volunteers and companies who contribute.

No single company can buy it, fork it, or kill it.

True open source. 🐘
December 5, 2025 at 9:32 AM
Reposted by PostgreSQL Hero
TIL: PostgreSQL's elephant mascot is named 'Slonik'.

The name comes from the Russian word for 'little elephant' (слоник).

Why an elephant? Because elephants never forget - just like PostgreSQL never loses your data. 🐘
December 5, 2025 at 9:31 AM
Reposted by PostgreSQL Hero
TIL: PostgreSQL was originally called POSTGRES (no SQL).

It was created at UC Berkeley in 1986 by Michael Stonebraker.

The 'SQL' was added in 1996 when SQL support was added. The name is a play on 'Ingres' - Stonebraker's previous database.

Post-Ingres → Postgres 🐘
December 5, 2025 at 9:31 AM
Reposted by PostgreSQL Hero
FUN FACT: https://postgresqlhero.vercel.app runs a full PostgreSQL database directly in your browser using PGlite.

No server. No backend. Just WASM magic under 3MB.

Learn SQL for free without us paying a cent for infrastructure 🐘
December 5, 2025 at 9:27 AM
Reposted by PostgreSQL Hero
A SQL query walks into a bar, walks up to two tables and asks...

"Can I join you?"
December 4, 2025 at 10:48 PM
Reposted by PostgreSQL Hero
One simple trick to speed up your queries 👇
December 4, 2025 at 10:48 PM
Reposted by PostgreSQL Hero
Every MySQL user eventually...
December 4, 2025 at 10:45 PM
Reposted by PostgreSQL Hero
PostgreSQL fans be like 🐘
December 4, 2025 at 10:44 PM
Reposted by PostgreSQL Hero
Top N per group? LATERAL JOIN.

The most underrated SQL feature.
December 4, 2025 at 10:42 PM
Reposted by PostgreSQL Hero
Division by zero? NULLIF handles it.

Returns NULL instead of crashing.
December 4, 2025 at 10:41 PM
Reposted by PostgreSQL Hero
Subqueries are unreadable.

CTEs are not. Use WITH.
December 4, 2025 at 10:41 PM
Reposted by PostgreSQL Hero
Need a comma-separated list from SQL?

STRING_AGG. No app code needed.
December 4, 2025 at 10:41 PM
Reposted by PostgreSQL Hero
INSERT or UPDATE? Both.

ON CONFLICT DO UPDATE = upsert in one atomic query.
December 4, 2025 at 10:41 PM
Reposted by PostgreSQL Hero
Need a list of dates? Don't loop.

generate_series() is your friend.
December 4, 2025 at 10:41 PM
Reposted by PostgreSQL Hero
COUNT with conditions? Use FILTER.

One query. Multiple counts. No subqueries.
December 4, 2025 at 10:41 PM
Reposted by PostgreSQL Hero
INSERT and get the ID back. One query.

Stop doing 2 round trips to your database.
December 4, 2025 at 10:40 PM
Reposted by PostgreSQL Hero
PostgreSQL's secret weapon: DISTINCT ON

Get the latest row per group in one query. No window functions needed.
December 4, 2025 at 10:40 PM
Reposted by PostgreSQL Hero
Stop writing CASE WHEN for null checks.

COALESCE exists.
December 4, 2025 at 10:40 PM