Black Friday: PGZen is $9.99 for a few days! 🖤
Fast, native macOS PostgreSQL client:
• Smart SQL autocomplete & ER diagrams
• Safe schema edits & visual EXPLAIN
• One-time purchase, no subscriptions
Grab your lifetime license: https://t.co/G7Y8JW7jwT
PostgreSQL 19 wins the race 🐘🚀
How long does it take to import 1 million CSV rows?
🐘 PostgreSQL 19 → 1.85 seconds
🐘 PostgreSQL 16 → 2.47 seconds*
🦭 MariaDB 10.11 → 3.05 seconds*
🐬 MySQL 26.10 → 5.03 seconds
🐘 PostgreSQL 18 → 5.60 seconds*
🦭 MariaDB 12.3 → 7.60 seconds*
🐬 MySQL 9.7 → 11.20 seconds*
PostgreSQL used COPY. MySQL and MariaDB used LOAD DATA.
https://t.co/riJyMMWlW4
Use INSERT ... ON CONFLICT for safe upserts.
Avoid SELECT followed by INSERT or UPDATE in application code—it suffers from race conditions under concurrent writes. Use INSERT ... ON CONFLICT with a UNIQUE constraint or index to handle conflicts atomically.
#PostgreSQL#SQL
Use IS DISTINCT FROM for null-safe comparisons
In SQL, NULL = NULL and NULL != 'active' both evaluate to UNKNOWN (falsy), which silently drops NULL rows from WHERE clauses.
IS DISTINCT FROM treats NULL as a comparable value, making it much cleaner than chaining OR col IS NULL.
@rauchg Just got into the mac appstore yesterday
Also we are giving away 3 free copies!
To enter:
1. Follow @PgZenApp on https://t.co/9B5Fr80lhw
2. Reply with what you're building with PostgreSQL
🏆 3 random winners on Nov 21!
🔗 https://t.co/nSEXMCu8Kb
🚀 PGZen is live on the Mac App Store!
A native PostgreSQL client for macOS.
🎁 Giving away 3 free copies!
To enter:
Follow @PgZenApp
Reply with what you're building with PostgreSQL
🏆 3 random winners on Nov 21!
🔗 https://t.co/nSEXMCu8Kb
Use COALESCE to safely handle NULL math and defaults
In SQL, any math or string concatenation involving NULL evaluates to NULL (100 + NULL = NULL). COALESCE returns the first non-null argument, making it essential for fallback values and safe calculations.
Always index your Foreign Keys
Postgres automatically creates a unique index for PRIMARY KEY and UNIQUE constraints, but not for FOREIGN KEY columns. It causes slow JOIN queries and full table scans on the child table whenever a parent row is updated or deleted.
Never use FLOAT or REAL for money
Floating-point types use binary approximations that cause rounding errors (0.1 + 0.2 != 0.3).
Always store currency using exact NUMERIC(p, s) or integer cents (BIGINT).
Use RETURNING to avoid extra SELECT round-trips
Don't run a second query just to fetch generated IDs, defaults, or updated values. Add RETURNING to INSERT, UPDATE, or DELETE to get the mutated rows back in a single database round-trip. #postgresql
JSON stores an exact text copy that Postgres must re-parse on every read. JSONB stores decomposed binary data, making reads much faster and unlocking GIN indexing and containment queries (@>), at the cost of only tiny write overhead.
Prefer IDENTITY over SERIAL
Avoid SERIAL and BIGSERIAL for new tables. GENERATED ALWAYS AS IDENTITY is the modern SQL standard, handles sequence permissions cleanly, and blocks accidental manual ID overrides.
TIMESTAMPTZ and TIMESTAMP both use 8 bytes, but TIMESTAMP drops timezone context and causes silent DST bugs — prefer TIMESTAMPTZ for almost everything.
Help agents write relevant Golang code with our new set of AI skills – Modern Go Guidelines.
They cover the most useful features from Go 1.0 to 1.27, including everything in the `modernize` analyzer, and instruct your agents to write modern idioms 👇
https://t.co/nDhA32CMny
This article by @func25 is one of the best Go articles I’ve read.
I had no idea what a goroutine was but learnt it due to this article
I also learnt more about concurrency in general, and how to effectively wait for a goroutine to finish
Would definitely recommend
https://t.co/Ri6fwN7JQr
#Golang #Learning