Database Reference
In-Depth Information
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
The other two user methods are for changing the friends list and telling the system
whether they want to receive mails that are only from friends. Error checking is omit-
ted here for brevity:
CREATE or REPLACE FUNCTION set_friends_list(
IN i_username text, IN i_friends_list
text[],
OUT status int, OUT message text )
AS $$
BEGIN
UPDATE user_info
SET friend_list = i_friends_list
WHERE username = i_username;
status = 200;
message = 'OK';
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
CREATE or REPLACE FUNCTION
msg_from_friends_only(
IN i_username text, IN i_friends_only boolean,
OUT status int, OUT message text )
AS $$
BEGIN
UPDATE user_info SET friends_only =
i_friends_only
WHERE username = i_username;
status = 200;
message = 'OK';
END;
$$ LANGUAGE plpgsql SECURITY DEFINER;
The function used for messaging simply send messages is as follows:
Search WWH ::




Custom Search