I'm not able to call a Function from my Postgres code on my Laravel system.
CREATE OR REPLACE FUNCTION usuario.funsetsessao(
login_p text,
ip_p text,
sistema_p text,
logar_p boolean)
RETURNS boolean AS
$BODY$
BEGIN
DROP TABLE IF EXISTS tmp_user_log;
CREATE TEMPORARY TABLE tmp_user_log ON COMMIT DROP AS
SELECT *, ip_p as ip, sistema_p as sistema, logar_p as logar
FROM usuario.usuario
WHERE login = login_p;
RETURN logar_p;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION usuario.funsetsessao(text, text, text, boolean)
OWNER TO postgres;
And this is my attempt to call the function in Laravel:
$result = DB::select('SELECT * FROM usuario.funsetssesion("adielson", "127.0.0.1", "teste", true)');
I would like help.