Re: Support a wildcard in backtrace_functions - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Support a wildcard in backtrace_functions
Date
Msg-id F4D246C1-D19B-478C-A3B8-DA6179812EEA@yesql.se
Whole thread Raw
In response to Support a wildcard in backtrace_functions  (Jelte Fennema-Nio <me@jeltef.nl>)
Responses Re: Support a wildcard in backtrace_functions
List pgsql-hackers
> On 20 Dec 2023, at 12:23, Jelte Fennema-Nio <me@jeltef.nl> wrote:

> Attached is a trivial patch that starts supporting
> backtrace_functions='*'. By setting that in postgresql.conf for my dev
> environment it starts logging backtraces always.

I happened to implement pretty much the same diff today during a debugging
session, and then stumbled across this when searching the archives, so count me
in for +1 on the concept.

> The main problem it currently has is that it adds backtraces to all
> LOG level logs too. So probably we want to make backtrace_functions
> only log backtraces for ERROR and up (or maybe WARNING/NOTICE and up),
> or add a backtrace_functions_level GUC too control this behaviour.

A wildcard should IMO only apply for ERROR (and higher) so I've hacked that up
in the attached v2. I was thinking about WARNING as well but opted against it.

> The docs of backtrace_functions currently heavily suggest that it should
> only be logging backtraces for errors, so either we actually start
> doing that or we should clarify the docs

I think we should keep the current functionality and instead adjust the docs.
This has already been shipped like this, and restricting it now without a clear
usecase for doing so seems invasive (and someone might very well be using
this). 0001 in the attached adjusts this.

--
Daniel Gustafsson


Attachment

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: [PATCH] Add sortsupport for range types and btree_gist
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: Support a wildcard in backtrace_functions