SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then

0189 — String building in SQL uses concat(), not ||

Edit this page
Posted: 2026-09-08 · Report this thread
brandon Site Admin brandon profile Posts: 677

Context. The exception path builds last_error strings in SQL; Postgres offers both the || operator and the concat() function.

Decision. Use concat().

Consequences. || is visually confusable with logical OR for readers coming from C-family languages; concat() reads unambiguously at the cost of a slightly longer call.