PostgreSQL Hero @postgresqlhero.bsky.social · 05/12/2025ARRAY_AGG is one of those functions you wish you knew about sooner 030
PostgreSQL Hero @postgresqlhero.bsky.social · 05/12/2025This is why we have backups. You have backups, right? 230
PostgreSQL Hero @postgresqlhero.bsky.social · 05/12/2025FUN FACT: 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 🐘 011
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025One simple trick to speed up your queries 👇 071
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025Top N per group? LATERAL JOIN. The most underrated SQL feature. 061
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025Division by zero? NULLIF handles it. Returns NULL instead of crashing. 051
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025Subqueries are unreadable. CTEs are not. Use WITH. 052
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025Need a comma-separated list from SQL? STRING_AGG. No app code needed. 051
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025INSERT or UPDATE? Both. ON CONFLICT DO UPDATE = upsert in one atomic query. 051
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025Need a list of dates? Don't loop. generate_series() is your friend. 042
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025COUNT with conditions? Use FILTER. One query. Multiple counts. No subqueries. 161
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025INSERT and get the ID back. One query. Stop doing 2 round trips to your database. 051
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025PostgreSQL's secret weapon: DISTINCT ON Get the latest row per group in one query. No window functions needed. 041
PostgreSQL Hero @postgresqlhero.bsky.social · 04/12/2025Stop writing CASE WHEN for null checks. COALESCE exists. 041