How can i know the depth of a stored procedure (they are called function in postgresql), that function calls two other recursive function ? Is it possible to know many time that function was called. The reason why i want to do that is because i would like to switch to an iterative approach rather than a recursive which is more efficient in my understanding.
The first function is below:
CREATE OR REPLACE FUNCTION public.generategrid(parameters)
RETURNS SETOF text AS
$BODY$
DECLARE
/* input params */
BEGIN
execute generaterowandcols(parameters)
END;
$BODY$
And as a mentioned above it calls another function
CREATE OR REPLACE FUNCTION public.generaterowandcols(parameters)
$BODY$
DECLARE
/* input params */
BEGIN
execute generaterow(parameters)
execute generaterowandcols(parameters)
END;
$BODY$
And the function that is before calls the fucntion below
CREATE OR REPLACE FUNCTION public.generaterow(parameters)
$BODY$
DECLARE
/* input params */
BEGIN
execute generaterow(parameters)
END;
$BODY$