Just found out about the other thread, which seems to describe an issue
that may well be related to the problems I observe in my multi-threaded
Python implementation using PostgreSQL 18:
https://www.postgresql.org/message-id/flat/CA%2BhUKG%2BHh7u3YpPLKQS%2BB7KJu0Bw99EjhuPuvBRVccDfgod95g%40mail.gmail.com#969d704180758e8dbd124604206175e0
As I have zero experience compiling PostgreSQL from scratch and
PostgreSQL development in general, I will unfortunately avoid going down
the rabbit hole of such an attempt to be able to test the patch, but
will eagerly await PG18.1 which hopefully will have it included and
might fix the issues I observed.
Marco