Annotation: office.get_sys_user_id

CREATE OR REPLACE FUNCTION office.get_sys_user_id()
RETURNS integer

Information: office.get_sys_user_id

Schema office
Function Name get_sys_user_id
Arguments
Owner postgres
Result Type integer
Description

Implementation: office.get_sys_user_id

CREATE OR REPLACE FUNCTION office.get_sys_user_id()
 RETURNS integer
 LANGUAGE plpgsql
AS $function$
BEGIN
    RETURN
    (
        SELECT office.users.user_id 
        FROM office.roles, office.users
        WHERE office.roles.role_id = office.users.role_id
        AND office.roles.is_system=true LIMIT 1
    );
END
$function$