I'm wondering if the limit for the number of locks in PostgreSQL is fixed, or if it depends on the number of open connections.
The docs say the limit is
max_locks_per_transaction * (max_connections + max_prepared_transactions), while this article claims the limit is
max_locks_per_transaction x number of currently open transactions.
I'm mainly trying to figure out if it makes any sense to monitor the total number of locks in PostgreSQL and trigger a warning on a fixed threshold. FWIW, we are not seeing any "out of memory" messages in the logs.