softwareheritage=> select convert_from(name, 'utf-8') as name, convert_from(email, 'utf-8') as email, convert_from(fullname, 'utf-8') as fullname from person where (name = '' or name is null) and (email = '' or email is null) and fullname is not null; name | email | fullname ------+-------+---------- | | ruby | | <> (2 rows)