Re: Debugging a function - what's the best way to do this quickly?

Поиск
Список
Период
Сортировка
От Melvin Davidson
Тема Re: Debugging a function - what's the best way to do this quickly?
Дата
Msg-id CANu8FixGHrvNUxxDsVd5U06JciAdtOo+aepzBj2=E+QfgTzLiQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Debugging a function - what's the best way to do this quickly?  (Kevin Burke <kev@inburke.com>)
Список pgsql-general


On Tue, Dec 19, 2017 at 2:47 PM, Kevin Burke <kev@inburke.com> wrote:
Can you describe what you mean by log statements? I have log_statement enabled and I can see the queries; the problem is the output is not logged and not what I expect. I need to modify the function so it shows the output of an intermediate CTE when I run it with specific inputs, and that's currently a little cumbersome.


On Tue, Dec 19, 2017 at 11:43 AM, Michael Nolan <htfoot@gmail.com> wrote:


On Tue, Dec 19, 2017 at 1:24 PM, Kevin Burke <kev@inburke.com> wrote:
I'm writing a function that looks a little like this:


This 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.

Assuming it's not a function in production yet, put some log statements in it, then check the logs.  If it's already in production, you'll probably have to create a separate version of the function for testing.
--
Mike Nolan


>Can you describe what you mean by log statements?

What he probably means is make use of the RAISE NOTIFY statement.


--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

В списке pgsql-general по дате отправления:

Предыдущее
От: Kevin Burke
Дата:
Сообщение: Re: Debugging a function - what's the best way to do this quickly?
Следующее
От: Kellner Thiemo
Дата:
Сообщение: RE: PostgreSQL suitable?