agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Euler Taveira <euler@eulerto.com>
Cc: Bryan Green <dbryan.green@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Jakub Wartak <jakub.wartak@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Date: Tue, 28 Oct 2025 18:51:20 +0200
Message-ID: <202510281643.xoy2do2in3bw@alvherre.pgsql> (raw)
In-Reply-To: <7379da2a-10e1-4fb2-bd77-212daf4b00b8@app.fastmail.com>

On 2025-Oct-27, Euler Taveira wrote:

> On Mon, Oct 27, 2025, at 2:58 PM, Bryan Green wrote:
> >     Thanks for even glancing at this.  I did not add any regression 
> > tests because the output goes to the server log and not the client.
> 
> Since Michael said WIN32-specific tests and mentioned log pattern, he is
> referring to TAP tests. You can add src/test/modules/test_backtrace that
> exercises this code path.

Hmm, are we really sure this is necessary?

> I didn't test your patch but I'm wondering if we could add an
> abstraction here.  I mean invent pg_backtrace() and
> pg_backtrace_symbols() that maps to the current functions (Unix-like).

Do we really need this?  I don't think we're going to add support for
backtraces anywhere else any time soon, so this looks premature.  What
other programs do you think we have where this would be useful?  I have
a really hard time imagining that things like psql and pg_dump would be
improved by having backtrace-reporting support.  And if we have a single
place in the code using a facility, then ISTM the platform-specific code
can live there with no damage.

If somebody is interested in adding backtracing other programs in the
future, they can introduce the abstraction then -- we will probably now
exactly what sort of API would be useful when we have more than one user
than now that we have just the backend, with very specific needs.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"La primera ley de las demostraciones en vivo es: no trate de usar el sistema.
Escriba un guión que no toque nada para no causar daños." (Jakob Nielsen)





view thread (36+ messages)  latest in thread

Message-ID: <202510281643.xoy2do2in3bw@alvherre.pgsql>
Permalink:  ../202510281643.xoy2do2in3bw@alvherre.pgsql/
Also on:    postgresql.org/message-id/202510281643.xoy2do2in3bw@alvherre.pgsql

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-hackers@postgresql.org
  Cc: alvherre@kurilemu.de, euler@eulerto.com, dbryan.green@gmail.com, michael@paquier.xyz, jakub.wartak@enterprisedb.com
  Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
  In-Reply-To: <202510281643.xoy2do2in3bw@alvherre.pgsql>

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

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