<pejac(at)altern(dot)org> writes:
> select bare_code::text from ean_article;
> ERROR: Cannot cast type 'ean13' to 'text'
> What can i do in my new type in order to use cast ???
You have to provide a conversion function, declared like
text(ean13) returns text
The cast syntax is just an alias for invoking this function.
regards, tom lane