PostgreSQL: How to restrict resources per DB, Schema or User
You can set many parameters on the database or user level with

ALTER DATABASE ... SET ...;
ALTER ROLE ... SET ...;


Connection limits can also be set on that level.

But a lot of things are global to the cluster (like shared_buffers), and a lot of resources (like CPU and I/O) cannot be limited at all.

I second the horse's comment to look at pg_cgroups, but I should mention that I am the author. That doesn't work on a database or user level though, but if you want to separate databases, it is always commendable to put them in different clusters anyway.