backtrace_functions emits trace for any elog

Started by Ilya Gladyshevabout 3 years ago2 messageshackers

Thread notes

1 note#bug#not-a-bug
hackorum-bot#bug#not-a-bug
hackorum-bot
1 day ago

@global #bug #not-a-bug

#bug#not-a-bug
Jump to latest
#1Ilya Gladyshev
ilya.v.gladyshev@gmail.com

Hi,
I used backtrace_functions to debug one of my ideas and found its behavior counter-intuitive and contradictory to it own docs. I think the GUC is supposed to be used to dump backtrace only on elog(ERROR) (should it also be done for higher levels? not sure about this), but, in fact, it does that for any log-level. I have attached a patch that checks log-level before attaching backtrace.

Regards,
Ilya

Attachments:

t48405_1
0001-check-elevel-before-attaching-backtrace.patchapplication/octet-stream; name=0001-check-elevel-before-attaching-backtrace.patch; x-unix-mode=0644Download+1-1
#2Noah Misch
noah@leadboat.com
In reply to: Ilya Gladyshev (#1)
Re: backtrace_functions emits trace for any elog

On Mon, Sep 04, 2023 at 09:30:32PM +0100, Ilya Gladyshev wrote:

I used backtrace_functions to debug one of my ideas and found its behavior counter-intuitive and contradictory to it own docs. I think the GUC is supposed to be used to dump backtrace only on elog(ERROR) (should it also be done for higher levels? not sure about this), but, in fact, it does that for any log-level. I have attached a patch that checks log-level before attaching backtrace.

This would make the feature much less useful. Better to change the docs.