Hi. I am writing a CMS using PHP and PostgreSQL. The CMS is capable of running multiple sites from a single codebase, using a unique set of tables per site / domain, differeing depending on which features are enabled.
I understand that PostgreSQL supports multiple schemas within a single database, and that access permissions are then set by schema.
My question is whether there are any security implications using a single schema per site within the same database?
This question has been really helpful in understanding the pros and cons either way, however it does not mention security aspects. The chosen answer states that PostgreSQL "schema" is equivalent to MySQL "database". If this is the case I'm comfortable with this approach. However, are there any security issues I should be aware of? My understanding is that the granular permissions used by PostgreSQL should protect each schema within a given database, however I'm not 100% sure on this.
Will this setup also make it possible to query across multiple schemas within a single query for a user with permissions on multiple schemas?
Any thoughts would be greatly appreciated, thanks in advance.