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

declare
  is_published__item_id                alias for $1;  
begin

  return
    count(*) > 0
  from
    cr_items
  where
    live_revision is not null
  and
    publish_status = 'live'
  and
    item_id = is_published__item_id;
 
end;$$ language plpgsql;