pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add GUC backtrace_on_internal_error
Date: Sat, 30 Dec 2023 10:47:46 +0000
Message-ID: <E1rJWsb-00Ccx9-M7@gemulon.postgresql.org> (raw)

Add GUC backtrace_on_internal_error

When enabled (default off), this logs a backtrace anytime elog() or an
equivalent ereport() for internal errors is called.

This is not well covered by the existing backtrace_functions, because
there are many equally-worded low-level errors in many functions.  And
if you find out where the error is, then you need to manually rewrite
the elog() to ereport() to attach the errbacktrace(), which is
annoying.  Having a backtrace automatically on every elog() call could
be very helpful during development for various kinds of common errors
from palloc, syscache, node support, etc.

Discussion: https://www.postgresql.org/message-id/flat/ba76c6bc-f03f-4285-bf16-47759cfcab9e@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a740b213d4b4d3360ad0cac696e47e5ec0eb8864

Modified Files
--------------
doc/src/sgml/config.sgml            | 27 +++++++++++++++++++++++++++
src/backend/utils/error/elog.c      |  8 +++++---
src/backend/utils/misc/guc_tables.c | 11 +++++++++++
src/include/utils/guc.h             |  1 +
4 files changed, 44 insertions(+), 3 deletions(-)



Message-ID: <E1rJWsb-00Ccx9-M7@gemulon.postgresql.org>
Permalink:  ../E1rJWsb-00Ccx9-M7@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rJWsb-00Ccx9-M7@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add GUC backtrace_on_internal_error
  In-Reply-To: <E1rJWsb-00Ccx9-M7@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox