If you want to know if a string contains at least one lowercase character, you can use the upper function [upper (mystr) = mystr]:
dbname=> select upper('AAbbCC')='AAbbCC'; ?column? ---------- f (1 row) dbname=> select upper('AABBCC')='AABBCC'; ?column? ---------- t (1 row)
You can use the same logic to verify that a string contains at least one uppercase character with a lower () sql function.
For a more complex pattern, you will need to use a regular expression or substring, as suggested by earlier answers.
Kemin zhou
source share