--
-- content_template__is_template/1
--
create or replace function content_template__is_template(
  integer
) returns bool as $$

declare
  is_template__template_id            alias for $1;  
begin
  
  return count(*) > 0 from cr_templates
    where template_id = is_template__template_id;
 
end;$$ language plpgsql;