An empty string and NULL communicate different conditions. NULLIF can normalize an empty import field where the schema expects a missing value.
Worked example
SELECT nullif('','') AS missing;Result
[
{
"missing": null
}
]Implementation notes
Whitespace-only values remain nonempty after NULLIF with an empty literal. Trim first only if surrounding whitespace is not part of the field's meaning.
Try it yourself
Compare an empty string, a space and a genuine NULL.
Open the SQL example →Editorial date September 1, 2025 · Published December 6, 2026