CREATE OR REPLACE FUNCTION core.get_unit_name_by_unit_id(integer) RETURNS text LANGUAGE plpgsql AS $function$ BEGIN RETURN unit_name FROM core.units WHERE unit_id=$1; END $function$