I have the ENUM type in postgresql
CREATE TYPE user_state AS ENUM (\'unconfirmed\', \'locked\', \'active\'); <
CREATE TYPE user_state AS ENUM (\'unconfirmed\', \'locked\', \'active\');
Very late to the party here, but I would like to add that in this specific case it is enough to simply cast the varchar to text to prevent recursion.
varchar
text
CREATE FUNCTION dummy_cast(varchar) RETURNS t_tl AS $$ SELECT ('' || $1)::t_tl; $$ LANGUAGE SQL;