Why do all databases have a public schema in PostgreSQL?
Solution 1:
There isn't much justification given, but see section [5.7.6][1] in the manual, but I think the following answers your question:
If you do not create any schemas then all users access the public schema implicitly. This simulates the situation where schemas are not available at all. This setup is mainly recommended when there is only a single user or a few cooperating users in a database. This setup also allows smooth transition from the non-schema-aware world.
Solution 2:
My guess would be the SQL spec. But, this is fairly logical what would create user
do otherwise, require you to explicitly say what schema the user had access too?
If your users don't have access to any single shared resource, why not just create a new DB for them? Unlike in MySQL, a new database is a new database, and not an alias for a new schema.
I just wanted to clarify this, it means that each database has its own public.
schema.