Proxy for PostgreSQL that forwards only configured query fingerprints and protocol messages.
Run it was pgfilterproxy <pgfilterproxy.yaml path>
.
See pgfilterproxy.yaml.example for a commented sample config.
You can gather fingerprints of denied queries by looking at the pgfilterproxy log.