I was just curious why all databases in PostgreSQL have a public schema that is accessible to all users. I know I can revoke privileges and grant them to one user but why is that not the default?
Thanks...
I was just curious why all databases in PostgreSQL have a public schema that is accessible to all users. I know I can revoke privileges and grant them to one user but why is that not the default?
Thanks...
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.
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.