Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Euler Taveira <euler(at)eulerto(dot)com>
Cc: Bryan Green <dbryan(dot)green(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Add Windows support for backtrace_functions (MSVC only)
Date: 2025-10-28 16:51:20
Message-ID: 202510281643.xoy2do2in3bw@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tanzeel Khan 2025-10-28 17:09:35 Missing post create object access hook in CreateForeignTable ?
Previous Message Nico Williams 2025-10-28 16:46:46 Re: Channel binding for post-quantum cryptography