If you have control of your postgresql server, updating my .conf using these suggestions fixed this for me:
I’m running a small server, product information data only for about 80k skus, so fairly chunky, but only really one system (well, two n8n instances) querying.
I used data-center as a preset which seems stable so far.