> Also, which process gets killed by the OOM killer? A random backend,
> walsender or some other process?
It was always a SELECT query that was killed. I assume it was because
of the GIN index we have with huge pending list. Postgres was
"terminating other connections because of crash of another server
process".