Config flag for disabling `Prefer: count=exact`
Author: steve-chavezCreated May 8, 2023Updated Aug 25, 2026
Labelsconfigidea
We currently rely on this guide for protecting against full counts on big tables: https://postgrest.org/en/v10.2/admin.html#count-header-dos
Which is incomplete because AFAICT Nginx can't remove a header based on a value OOTB. It will always remove the whole header. We'd need OpenResty for this.
Now, this problem has already been solved with the estimated and planned count.
We just need to disable the Prefer: count=exact. We can do this with a config option.
db-exact-count-enable = falseSource: PostgREST/postgrest