I find the problem is in my outer procedure, because it has no sleep there,
and I change it calling pg_sleep:
-- Function: "TestProcOuter"()
-- DROP FUNCTION "TestProcOuter"();
CREATE OR REPLACE FUNCTION "TestProcOuter"() RETURNS integer AS
$BODY$
DECLARE Loops int4 := 1;
BEGIN LOOP RAISE NOTICE 'TestProcOuter: % loop', Loops; IF 0 = "TestProcInner"() THEN
EXIT; -- LOOP END IF; Loops = Loops + 1; PERFORM
pg_sleep(4); END LOOP;
RETURN 0;
END;
$BODY$ LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION "TestProcOuter"() OWNER TO postgres;
With this change, I found the first session succeeds, the CPU is not rised
anymore, but the second session doesn't succeed even after the first one
finish successfully.
It fails forever.
Why ? What have I make to succeed ?
TIA,
Sabin