Hi djbob,
SELECT COUNT(*) FROM pg_language WHERE lanname = 'plpgsql';
count
0
and I try to create a function
CREATE OR REPLACE FUNCTION dologin(IN i_user varchar, IN i_password varchar, OUT o_group integer) RETURNS INTEGER AS
$$
DECLARE
BEGIN
SELECT group_id INTO o_group FROM users WHERE nick=i_user AND password=i_password;
IF NOT FOUND THEN
SELECT 0 INTO o_group;
END IF;
RETURN;
END;
$$ LANGUAGE plpgsql;
Because the plgpsql is not loaded by default I should to be loaded at the schema you want.
I try on a Centos Virtual Machine and loaded the plpsql as postgres and other user wiht other schema cant access it.
Thanks for your time djbob.