I'm writing a function that looks a little like this:
DROP FUNCTION IF EXISTS myfunction;
CREATE OR REPLACE FUNCTION myfunction(arg1 uuid,
_symbol text,
_start timestamp with time zone,
_end timestamp with time zone
) RETURNS TABLE (arg5 date, arg6 float)
AS $$
WITH cte1 AS ( ... ),
cte2 AS ( ... ),DROP FUNCTION IF EXISTS myfunction;
CREATE OR REPLACE FUNCTION myfunction(arg1 uuid,
_symbol text,
_start timestamp with time zone,
_end timestamp with time zone
) RETURNS TABLE (arg5 date, arg6 float)
AS $$
WITH cte1 AS ( ... ),
$$
- Delete the function prologue and epilogue
- Replace every use of the input arguments with the hardcoded values I want to test withThis seems pretty cumbersome. Is there an easier way I am missing? Specifically it would be neat if it was easier to visualize the intermediate steps in the query production. If there are professional tools that help with this I would appreciate pointers to those as well.