How do one limit the size of a PostgreSQL table? (or schema)
Limit in either bytes or rows would be OK.
I'm starting to think that there's no easy and obvious solution.
I have a lot of identical tables in multiple schemas (my take on multi-tenancy) and I would like to restrict each schema to a certain max size.
I have yet to find anything in Postgres that allows me to turn on any kind of quota. So I suppose you need to build this functionality yourself.
The naive 'solution' would be to do something like:
insert only if select count(*) < max quota.
But that does not feel right.
Anyone with better solutions in mind?