CREATE OR REPLACE FUNCTION core.get_account_id_by_account_number(text) RETURNS bigint LANGUAGE plpgsql STABLE AS $function$ BEGIN RETURN account_id FROM core.accounts WHERE account_number=$1; END $function$