Re: Support a wildcard in backtrace_functions

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: Support a wildcard in backtrace_functions
Дата
Msg-id F19A34F3-9E5B-4778-838D-5DD45A4C6BB1@yesql.se
обсуждение исходный текст
Ответ на Re: Support a wildcard in backtrace_functions  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
> On 8 Mar 2024, at 15:01, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote:

> So, to get backtraces of all functions at
> backtrace_functions_min_level level, one has to specify
> backtrace_functions = '*'; combining it with function names is not
> allowed. This looks cleaner.
>
> postgres=# ALTER SYSTEM SET backtrace_functions = '*, pg_create_restore_point';
> ERROR:  invalid value for parameter "backtrace_functions": "*,
> pg_create_restore_point"
> DETAIL:  Invalid character

If we want to be extra helpful here we could add something like the below to
give an errhint when a wildcard was found.  Also, the errdetail should read
like a full sentence so it should be slightly expanded anyways.

diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index ca621ea3ff..7bc655ecd2 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -2151,7 +2151,9 @@ check_backtrace_functions(char **newval, void **extra, GucSource source)
                                          ", \n\t");
        if (validlen != newvallen)
        {
-               GUC_check_errdetail("Invalid character");
+               GUC_check_errdetail("Invalid character in function name.");
+               if ((*newval)[validlen] == '*')
+                       GUC_check_errhint("For wildcard matching, use a single \"*\" without any other function
names.");
                return false;
        }

--
Daniel Gustafsson




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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Support a wildcard in backtrace_functions
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Introduce XID age and inactive timeout based replication slot invalidation