--
-- content_item__unrelate/1
--
create or replace function content_item__unrelate(
  integer
) returns int4 as $$

declare
  unrelate__rel_id      alias for $1;  
begin

  -- delete the relation object
  PERFORM acs_rel__delete(unrelate__rel_id);

  -- delete the row from the cr_item_rels table
  delete from cr_item_rels where rel_id = unrelate__rel_id;

  return 0; 
end;$$ language plpgsql;