I wan't to be sure that not a empty text can be stored into my table. Therefore I created a domain type:
CREATE DOMAIN non_empty_text AS TEXT CHECK( VALUE ~ '\S' );
and changed all text types to non_empty_text.
So far so good. But would it be more efficient when I would change the type back to text and create a UNIQUE index and a row with empty values?
You of course need to benchmark this, but offhand, I'd say you should change your approach.
The current domain type logic you have evaluates the string in memory. The second approach requires accessing an index and looking for a block that may or may not be in the cache. Accessing the storage, even if it doesn't happen all the time, is so expensive compared to an in-memory operation, that this probably isn't a good idea.