CREATE OR REPLACE FUNCTION policy.is_transaction_restricted(_office_id integer) RETURNS boolean LANGUAGE plpgsql STABLE AS $function$ BEGIN RETURN NOT allow_transaction_posting FROM office.offices WHERE office_id=$1; END $function$