-
-
Save jheidt/32df7bf593bbb9b0b2bd to your computer and use it in GitHub Desktop.
Find empty strings or strings containing only whitespace, for postgresql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION empty(TEXT) | |
RETURNS bool AS | |
$$ SELECT $1 ~ '^[[:space:]]*$'; $$ | |
LANGUAGE sql | |
IMMUTABLE; | |
COMMENT ON FUNCTION empty(TEXT) | |
IS 'Find empty strings or strings containing only whitespace'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment