Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 2
    Did you check this for the NULL case?
    – Flinsch
    Commented Jan 14, 2020 at 9:45
  • 2
    Yes, I did. It does not return empty nor null string fields.
    – yglodt
    Commented Jan 14, 2020 at 11:58
  • 1
    If you just need to check only empty values, then try this -> where length(stringexpression) = 0;. This works for me. Commented Jun 5, 2020 at 12:15
  • I like this solution, just note that is some cases calculating exact length may be relatively expensive operation.
    – noonex
    Commented Jul 28, 2021 at 12:01
  • 2
    In postgres, length(NULL) > 0 return NULL, not False.
    – Automatico
    Commented Sep 19, 2022 at 12:43