February 3, 2026
Plus vs Pipes: who wins?
Same SQL, Different Results: A Subtle Oracle vs. PostgreSQL Migration Bug
A tiny + vs || mix‑up sparks big Oracle vs Postgres flamewar
TLDR: Same SQL gave different results in Oracle and PostgreSQL because one concatenates text before math and the other does math first. Comments split between “useful warning” and “too long for a simple point,” but everyone agrees this silent mismatch can wreck migrations and deserves attention.
Same code, different numbers — and the internet has feelings. A new post shows how a harmless-looking line turns 15:59 into “1500” in Oracle but “14100” in PostgreSQL because Oracle “helps” by gluing text first, while Postgres does the math first. The lesson: two databases can read the same recipe and bake different cakes. And the crowd? Spicy.
The comment section lit up faster than a pager at 2 a.m. One reader swung in with “Obviously written by AI,” turning a database demo into a meta-drama about tech writing itself. Another shot back that it’s a “really long article” to say “+ and || have different priorities,” sparking the classic split: team useful cautionary tale vs team could’ve been one sentence. In the sidelines, memes rolled in: “concatenate first, ask questions later,” “plus vs pipes: choose your fighter,” and “Oracle the mind reader vs Postgres the hall monitor.”
Defenders praised the real-world repro, saying it’s exactly the kind of quiet bug that ships to production and ruins dashboards. Skeptics demanded shorter, punchier warnings. Both sides agreed on one thing: migration isn’t copy-paste. The subtext was loud and clear — test, cast, and never trust your gut with SQL.
Key Points
- •A migration from Oracle to PostgreSQL produced different results for the same-looking SQL due to evaluation differences.
- •Oracle’s implicit casting leads to concatenation occurring before arithmetic, affecting numeric outcomes.
- •PostgreSQL enforces operator precedence with arithmetic evaluated before concatenation and requires explicit casts.
- •A test case (end_hr=15, minutes=59) yields Oracle result 1500 versus PostgreSQL result 14100.
- •The article emphasizes using explicit parentheses and careful type handling to preserve intended logic during migrations.