How to modify existing function to return all rows from table sd_users?
CREATE OR REPLACE FUNCTION getusers()
RETURNS sd_users AS
$BODY$
DECLARE
groups sd_users;
BEGIN
SELECT * INTO groups FROM sd_users;
RETURN groups;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION getusers()
OWNER TO postgres;
Invoke the function code:
SELECT getusers()
This code returns only first record, how to make it to return all records?