-- -- static_page__get_show_comments_p/1 -- create or replace function static_page__get_show_comments_p( integer ) returns bool as $$ declare p_item_id alias for $1; -- p_ stands for parameter v_show_comments_p static_pages.show_comments_p%TYPE; begin select show_comments_p into v_show_comments_p from static_pages where static_page_id = p_item_id; return v_show_comments_p; end;$$ language plpgsql;