I would like to set a maximum number of rows on a PostgreSQL table. I want users to be able to delete and recreate rows if need be; but there should never be more than x rows in my table. Is there a way to add such a constraint to a table - or a workaround to achieve the same goal?
The purpose of this is to prevent people from adding too many new polygons in a table. I'm looking for either a general SQL solution or a PostGIS-related solution (based on geometry for example).