Re: [PATCH] Add Windows support for backtrace_functions (MSVC only) - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Date
Msg-id 202510281643.xoy2do2in3bw@alvherre.pgsql
Whole thread Raw
In response to Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)  ("Euler Taveira" <euler@eulerto.com>)
List pgsql-hackers
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)



pgsql-hackers by date:

Previous
From: Nico Williams
Date:
Subject: Re: Channel binding for post-quantum cryptography
Next
From: Tanzeel Khan
Date:
Subject: Missing post create object access hook in CreateForeignTable ?