Re: Support a wildcard in backtrace_functions

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Jelte Fennema-Nio <me(at)jeltef(dot)nl>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Re: Support a wildcard in backtrace_functions
Date: 2024-02-12 13:14:20
Message-ID: F4D246C1-D19B-478C-A3B8-DA6179812EEA@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 20 Dec 2023, at 12:23, Jelte Fennema-Nio <me(at)jeltef(dot)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 Content-Type Size
v2-0002-Support-wildcard-in-backtrace_functions-to-handle.patch application/octet-stream 3.9 KB
v2-0001-doc-Clarify-when-backtrace_functions-is-invoked.patch application/octet-stream 1.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-02-12 13:27:42 Re: Support a wildcard in backtrace_functions
Previous Message jian he 2024-02-12 13:00:00 Re: [PATCH] Add sortsupport for range types and btree_gist