Spam over the Postgres binary protocol is not loud. It does not flood your logs with giant screams of attack. It slips in as unexpected queries, malformed frames, or stealthy bursts of connections. One bad actor can trigger a denial of service. Several can quietly extract or poison your data. If you proxy Postgres traffic without an anti-spam policy, you are exposed.
The Postgres binary protocol is compact, fast, and unforgiving. Proxies that handle it need to account for its stateful nature. A weak filter misses handshake abuse. A naive parser fails to detect protocol violations. Attackers know this. They use malformed startup messages to bypass logic. They inject idle connections in bursts to waste pool resources. They mask automated scraping as legitimate prepared statements. Without a proper anti-spam policy, your proxy becomes an open lane for hostile traffic.
A strong anti-spam policy for Postgres binary protocol proxying needs more than IP rate limiting. It must include: