--
-- content_type__unregister_relation_type/3
--
create or replace function content_type__unregister_relation_type(
  character varying,
  character varying,
  character varying
) returns int4 as $$

declare
  unregister_relation_type__content_type  alias for $1;  
  unregister_relation_type__target_type   alias for $2;  
  unregister_relation_type__relation_tag  alias for $3;  -- default null  
                                        
begin

  delete from 
    cr_type_relations
  where 
    content_type = unregister_relation_type__content_type
  and 
    target_type = unregister_relation_type__target_type
  and
    relation_tag = unregister_relation_type__relation_tag;

  return 0; 
end;$$ language plpgsql;