-- -- apm_package__name/1 -- create or replace function apm_package__name( integer ) returns varchar as $$ declare name__package_id alias for $1; v_result apm_packages.instance_name%TYPE; begin select instance_name into v_result from apm_packages where package_id = name__package_id; return v_result; end;$$ language plpgsql;