On 2024-06-12 We 11:28, Andres Freund wrote:
Hi,
On 2024-06-11 08:04:57 -0400, Andrew Dunstan wrote:
Some time ago I did some work on wrapping libpq using the perl FFI module.
It worked pretty well, and would mean we could probably avoid many uses of
IPC::Run, and would probably be substantially more efficient (no fork
required). It wouldn't avoid all uses of IPC::Run, though.
FWIW, I'd *love* to see work on this continue. The reduction in test runtime
on windows is substantial and would shorten the hack->CI->fail->hack loop a
good bit shorter. And save money.
OK, I will put it high on my list. I just did some checking and it seems
to be feasible on Windows. StrawberryPerl at least has FFI::Platypus out
of the box, so we would not need to turn any great handsprings to make
progress on this on a fairly wide variety of platforms.
What seems a good place to start would be a simple
PostgreSQL::Test::Session object that would allow us to get rid of a
whole heap of start/pump_until/kill cycles and deal with the backend in
a much more straightforward and comprehensible way, not to mention the
possibility of removing lots of $node->{safe_}psql calls.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com