CREATE FUNCTION outer_function(param1 DATE) RETURNS text AS $$
DECLARE
FUNCTION inner_function1 IS
BEGIN
-- do something to calculate output_day
RAISE NOTICE 'INNER FUNCTION';
END;
FUNCTION inner_function2 IS
BEGIN
-- do something to calculate output_day
RAISE NOTICE 'INNER FUNCTION';
END;
BEGIN
RAISE NOTICE 'OUTER FUNCTION BODY';
-- call inner_function1
inner_function1;
-- call inner_function2
inner_function2;
RETURN 'TRUE';
END;
$$ language plpgsql;
如何在declare块中定义函数? 我必须在声明块中定义函数并从begin调用它。 请建议在postgresql中使用