-- -- news__name/1 -- create or replace function news__name( integer ) returns varchar as $$ declare p_news_id alias for $1; v_news_title cr_revisions.title%TYPE; begin select title into v_news_title from cr_revisions where revision_id = p_news_id; return v_news_title; end; $$ language plpgsql;