"Robert Wimmer" <seppwimmer@hotmail.com> writes:
> I want to define a schema qualified domain and create a cast to cast a
> string in the new domain.
Casts between domains and their underlying types are hard-wired into the
system: you don't get to muck with the semantics by doing CREATE CAST.
The correct way to do this is to define a constraint on the domain,
along the lines of
create function is_ok_ident(text) returns bool as '
... return true if you like the string ...
' language plpgsql;
create domain ident as text check (is_ok_ident(value));
regards, tom lane