proposal: enhancing plpgsql debug API - returns text value of variable content

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема proposal: enhancing plpgsql debug API - returns text value of variable content
Дата
Msg-id CAFj8pRD+dBPU0T-KrkP7ef6QNPDEsjYCejEsBe07NDq8TybOkA@mail.gmail.com
обсуждение исходный текст
Ответы Re: proposal: enhancing plpgsql debug API - returns text value of variable content  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Hi

I am working on tracing support to plpgsql_check


I would like to print content of variables - and now, I have to go some deeper than I would like. I need to separate between scalar, row, and record variables. PLpgSQL has code for it - but it is private.

Now plpgsql debug API has an API for expression evaluation - and it is working fine, but there is a need to know the necessary namespace. Unfortunately, the plpgsql variables have not assigned any info about related namespaces. It increases the necessary work for implementing conditional breakpoints or just printing all variables (and maintaining a lot of plpgsql code outside plpgsql core).

So my proposals:

1. enhancing debug api about method

char *get_cstring_valule(PLpgSQL_variable *var, bool *isnull)

2. enhancing PLpgSQL_var structure about related namespace "struct PLpgSQL_nsitem *ns",
PLpgSQL_stmt *scope statement (statement that limits scope of variable's visibility). For usage in debuggers, tracers can be nice to have a info about kind of variable (function argument, local variable, automatic custom variable (FORC), automatic internal variable (SQLERRM, FOUND, TG_OP, ...).

Comments, notes?

Regards

Pavel


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

Предыдущее
От: yuzuko
Дата:
Сообщение: Re: Autovacuum on partitioned table (autoanalyze)
Следующее
От: Pavel Stehule
Дата:
Сообщение: proposal - reference to plpgsql_check from plpgsql doc