Debugging a function - what's the best way to do this quickly?
От | Kevin Burke |
---|---|
Тема | Debugging a function - what's the best way to do this quickly? |
Дата | |
Msg-id | CAGs5PJKgAzGyOgBjUtkazLmm4BQrHZZ2km36LU11gWUs=hRoWQ@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Debugging a function - what's the best way to do this quickly?
Re: Debugging a function - what's the best way to do this quickly? Re: Debugging a function - what's the best way to do this quickly? |
Список | pgsql-general |
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.
В списке pgsql-general по дате отправления: